在编辑器中禁用约束 - >
问题描述:
我试图在故事板上设置对UITableView的约束。在编辑器 - >销号选项中,约束被禁用。在编辑器中禁用约束 - >
他们为什么不启用?
更新:Gabbler的意见正确地指出,的tableView是最上面的观点,你不用做就可以了针的动作。我设置约束的目的是为了在应用程序运行时将缺省的引导空间设置为缺省的tableView。请检查截图:
答
你在找什么是separatorInset
和layoutMargins
。在viewDidLoad
:
self.tableView.layoutMargins = UIEdgeInsetsZero;
self.tableView.separatorInset = UIEdgeInsetsZero;
并添加此方法。
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
Is Destination a tableViewController? – gabbler 2014-12-27 16:25:20
是的,它是UITableViewController。 – Nitish 2014-12-27 16:25:48
然后tableView是最上面的视图,你不必对它执行pin操作。 – gabbler 2014-12-27 16:28:52