iOS8:分隔符零和附件视图披露指示器

时间:2014-09-29 08:06:36

标签: ios autolayout

我已经了解了如何在iOS 8中再次使单元格全宽,以便分隔符延伸到左边缘。

-(void)viewDidLayoutSubviews
{
    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
        [self.tableView setSeparatorInset:UIEdgeInsetsZero];
    }

    if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
        [self.tableView setLayoutMargins:UIEdgeInsetsZero];
    }
}

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

    if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
        [cell setSeparatorInset:UIEdgeInsetsZero];
    }

    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }

    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
}

然而,在我的视图控制器加载后,披露指示器及其左侧的标签"跳转"稍微离一点,用户可以看到。我已将标签的约束设置为"标签的尾随空间为Superview x"。那为什么会跳这个?我怎么能避免呢?太烦人了...我还尝试过设置约束而不是边距,但相对于没有边距的视图而且跳转仍然存在

0 个答案:

没有答案
相关问题