2015-03-02 104 views
1

在一个应用程序中使用搜索显示控制器空白空间,它工作正常在IOS 7,但在IOS 8它示出了在检索显示表中的右侧的空白空间如下的iOS 8 - 搜索显示控制器显示在右

enter image description here

尝试了很多,但没有得到任何解决方案。

+0

任何机会,这是在更广泛的手机上运行?如果你使用的是自定义tableView单元格,请确保背景(红色)不是硬编码以适合较小的手机。 – DevC 2015-03-02 11:51:22

+0

@DevC它不是硬编码,我在iOS 7上检查iPhone 5S时工作正常;但与iOS 8的iPhone 5S给出了上述问题 – Shardul 2015-03-02 12:01:20

+0

你检查了cellType的accessoryType吗? – las 2015-03-02 12:04:28

回答

1

这可能是因为layoutMargins。尝试将此方法添加到您的表视图的代表,看看事情是否按预期工作:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    // Remove seperator inset 
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { 
     [cell setSeparatorInset:UIEdgeInsetsZero]; 
    } 

    // Prevent the cell from inheriting the Table View's margin settings 
    if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) { 
     [cell setPreservesSuperviewLayoutMargins:NO]; 
    } 

    // Explictly set your cell's layout margins 
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { 
     [cell setLayoutMargins:UIEdgeInsetsZero]; 
    } 

} 
+0

伟大的解决方案,谢谢 – Shardul 2015-03-02 12:16:12