The UITableView
below has custom UITableViewCells
and I can adjust the separators fine using this line in the custom UITableViewCell
:
self.separatorInset = UIEdgeInsetsMake(0, kDefaultSeparatorLeftInset, 0, 0);
However the cell at the bottom of the section has a default separator that overrides the custom UIEdgeInsets
that I set.
I'd like all the separators to be the same width, is there any way of doing this without redrawing the separators manually?
After some experimentation I've found the only real solution is to set the UITableViewStyle
to UITableViewStylePlain
and set empty footers using:
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return [[UIView alloc] initWithFrame:CGRectZero]; } -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 0.01f; }
This will not be a satisfactory solution for some, because UITableViewStylePlain
does not provide all of the features of UITableViewStyleGrouped
, but it gives me the section without the full-width separator.
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