Created
December 5, 2015 02:47
-
-
Save warriorg/9734814157cbff51823a to your computer and use it in GitHub Desktop.
UITableView separator inset
This file contains 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
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
// Remove seperator inset | |
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { | |
[cell setSeparatorInset:UIEdgeInsetsZero]; | |
} | |
// Prevent the cell from inheriting the Table View's margin settings | |
if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) { | |
[cell setPreservesSuperviewLayoutMargins:NO]; | |
} | |
// Explictly set your cell's layout margins | |
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { | |
[cell setLayoutMargins:UIEdgeInsetsZero]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment