For iOS7:
if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[self.tableView setSeparatorInset:UIEdgeInsetsZero];
}
For iOS8:
First configure your table view as follows:
if ([self.tableView respondsToSelector:@selector(layoutMargins)]) {
self.tableView.layoutMargins = UIEdgeInsetsZero;
}
Then in your cellForRowAtIndexPath: method, configure the cell as follows:
if ([cell respondsToSelector:@selector(layoutMargins)]) {
cell.layoutMargins = UIEdgeInsetsZero;
}
Note: Include both layoutMargins and separatorInset, to support both iOS versions
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…