iOS快速删除UITableView单元分隔符空间
我想删除tableView分隔符,我通过将分隔符样式设置为无,这将删除分隔符,但留下单元格之间的空间。
我的问题是如何删除单元格之间的空间?
任何帮助,将不胜感激。
在awakeFromNib
函数中设置UIEdgeInsetsZero
UITableViewCell
选项应该可以工作
self.layoutMargins = UIEdgeInsetsZero self.separatorInset = UIEdgeInsetsZero
我在cellForRowAtIndexPath
// remove the spaces on the cell separators if (cell.respondsToSelector("setPreservesSuperviewLayoutMargins:")) { cell.preservesSuperviewLayoutMargins = false } cell.separatorInset = UIEdgeInsetsZero if(cell.respondsToSelector("setLayoutMargins:")){ cell.layoutMargins = UIEdgeInsetsZero }