Created
October 1, 2015 10:38
-
-
Save bynil/f431cbc95ce66f8f5fef to your computer and use it in GitHub Desktop.
UITableViewCell separator inset fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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