1、estimatedRowHeight、estimatedSectionHeaderHeight、estimatedSectionFooterHeight均设为0
2、表头高度sectionHeaderHeight和表尾高度sectionFooterHeight,有值时设置,无值时设为0
3、区头高度heightForHeaderInSection和区尾高度heightForFooterInSection设置为0.01,不要设为0
4、实现区头viewForHeaderInSection和区尾viewForFooterInSection方法
5、tableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREENW, CGFLOAT_MIN)];//高度设为0.01或者CGFLOAT_MIN
6、iOS15头部空白问题:if (@available(ios 15.0,*)) { tableView.sectionHeaderTopPadding = 0;}
7、这两个代理方法放在以上6种代码之前,有时顺序不对也会有空白:tableView.delegate = self;tableView.dataSource = self;