I have an app where the UITableView
\'s separator inset is set to custom values - Right 0
, Left 0
. This works perfectly in iOS 7.
Most answers are showing separator insets and layout margins being set over a variety of methods (i.e., viewDidLayoutSubviews
, willDisplayCell
, etc) for cells and tableviews, but I've found that just putting these in cellForRowAtIndexPath
works great. Seems like the cleanest way.
// kill insets for iOS 8
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) {
cell.preservesSuperviewLayoutMargins = NO;
[cell setLayoutMargins:UIEdgeInsetsZero];
}
// iOS 7 and later
if ([cell respondsToSelector:@selector(setSeparatorInset:)])
[cell setSeparatorInset:UIEdgeInsetsZero];