本文介绍: 3、区头高度heightForHeaderInSection和区尾高度heightForFooterInSection设置为0.01,不要设为0。2、表头高度sectionHeaderHeight表尾高度sectionFooterHeight,有值时设置,无值时设为0。

1、estimatedRowHeightestimatedSectionHeaderHeightestimatedSectionFooterHeight均设为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;

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注