I'm trying to set insets in my tableview so that each cell does not stick to each other.
To do this, I've added the following method to my tableView:willDisplayCell:forRowAtIndexPath:
if([tableView respondsToSelector:@selector(setSeparatorInset:)]){
[tableView setSeparatorInset:UIEdgeInsetsMake(10, 15, 10, 15)];
}
I basically want a 10pt space on the top and bottom of the cell, before the next cell. This code partially works, because there is a visible 15pt inset on the left and right. However, the top and bottom are still connected.
Thanks!
~Carpetfizz
The top and bottom values are ignored UITableViewCell Class Reference (separatorInset):
[...]Only the left and right inset values are respected; the top and bottom inset values are ignored.[...]
I'd recommend to do the spacing by increasing the height of the cells and place the content with an appropriate padding to the top and bottom edge.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With