我想知道为什么如果我设置(在故事板自定义分隔符插入左= 0,右= 0)为什么左侧仍然有空间,它不完全是左边框?
如你所见,右侧正好在边界 .
请在代码中添加它并运行项目 .
试试这个 :-
在声明表格视图的位置添加此项
[self.tableView setContentInset:UIEdgeInsetsZero]; // Set seperator to start from zero if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) [self.tableView setSeparatorInset:UIEdgeInsetsZero];
并在 cellForRowAtIndexPath 方法中添加此项
cellForRowAtIndexPath
cell.layoutMargins = UIEdgeInsetsZero; cell.preservesSuperviewLayoutMargins = NO;
2 回答
请在代码中添加它并运行项目 .
试试这个 :-
在声明表格视图的位置添加此项
并在
cellForRowAtIndexPath
方法中添加此项