This question already has answers here: Is there a way to make UITableView cells in iOS 7 not have a line break in the separator? (17 answers) Closed 8 years ago.
UITableView draws with ragged lines on iOS 7:
https://i.stack.imgur.com/OE69H.png
How to fix it? The line between cells should be on the full width of the screen.
UITableView
has a property separatorInset
. You can use that to set the insets of the table view separators to zero to let them span the full width of the screen.
[tableView setSeparatorInset:UIEdgeInsetsZero];
Note: If your app is also targeting other iOS versions, you should check for the availability of this property before calling it by doing something like this:
if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[tableView setSeparatorInset:UIEdgeInsetsZero];
}
This is default by iOS7 design. try to do the below:
[tableView setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)];
You can set the 'Separator Inset' from the storyboard:
https://i.stack.imgur.com/6esYR.png
https://i.stack.imgur.com/ViW4c.gif
Success story sharing
if ([self.tableView respondsToSelector:@selector(setSeparatorStyle:)]) { [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; }
tableView.layoutMargins = UIEdgeInsetsZero;
and in your cellForRowAtIndexPath method:cell.layoutMargins = UIEdgeInsetsZero;