Reputation: 117
i am trying to remove the tableView separator, i do that by setting the separator style to none, this removes the separator but leaves the space between the cells.
My question is how do i remove that space between the cells?
Any help would be appreciated.
Upvotes: 0
Views: 2550
Reputation: 8216
I do it in 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
}
Upvotes: -2
Reputation: 7013
In awakeFromNib
function setting UITableViewCell
options to UIEdgeInsetsZero
should work
self.layoutMargins = UIEdgeInsetsZero
self.separatorInset = UIEdgeInsetsZero
Upvotes: 7