去除多余的cell 和最后一行cell显示顶头底线
- 去除多余cell
- YourTableview.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
- 最后一行cell底线顶头显示
-
static void setLastCellSeperatorToLeft(UITableViewCell* cell)
{
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
if([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
[cell setPreservesSuperviewLayoutMargins:NO];
}
}