If I set a red separatorColor
on a table view in iOS 7 and also set the separatorInset
to UIEdgeInsetsZero
or any other custom inset value, all additional or "extra" rows have default colored separators. How can I fix this?
The last sentence of the documentation on separatorInset
implies that it somehow controls the extra records, but I don't see how:
In iOS 7 and later, cell separators do not extend all the way to the edge of the table view. This property sets the default inset for all cells in the table, much like
rowHeight
sets the default height for cells. It is also used for managing the "extra" separators drawn at the bottom of the plain style tables.
Set the separator in viewDidLoad
:
self.tableView.separatorColor = [UIColor redColor];
And you get this:
And when you set the separatorInset
and a color:
self.tableView.separatorInset = UIEdgeInsetsZero; // <- any custom inset will do
self.tableView.separatorColor = [UIColor redColor];
You get this:
Why does this happen and how can I make all the separators red and set all the separator insets to zero? Is this a bug?