去除多余的cell 和最后一行cell显示顶头底线

  1. 去除多余cell
  2. YourTableview.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];  
  3. 最后一行cell底线顶头显示
  4. 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];

        }

    }

      

原文地址:https://www.cnblogs.com/FZP5/p/5545142.html