Skip to content

Instantly share code, notes, and snippets.

@bynil
Created October 1, 2015 10:38
Show Gist options
  • Save bynil/f431cbc95ce66f8f5fef to your computer and use it in GitHub Desktop.
Save bynil/f431cbc95ce66f8f5fef to your computer and use it in GitHub Desktop.
UITableViewCell separator inset fix
//UITableView
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[tableView setSeparatorInset:UIEdgeInsetsMake(0, 16, 0, 0)];
}
if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
[tableView setLayoutMargins:UIEdgeInsetsZero];
}
}
//Cell
- (UIEdgeInsets)layoutMargins {
return UIEdgeInsetsZero;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment