问题:
由于不想让tableView footer上添加的视图有悬浮效果, 把tableView改为了group类型, 没想到的是上下出现了留白.
正确解决方式:
self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0.01, 0.01)];
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0.01, 0.01)];
错误方式
self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectZero];
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
有副作用的解决
self.tableView.contentInset = UIEdgeInsetsMake(-35, 0, 0, 0);
无用
self.tableView.estimatedSectionHeaderHeight = 0.01;
self.tableView.estimatedSectionFooterHeight = 0.01;
if (@available(iOS 15.0, *)) {
[self.tableView setSectionHeaderTopPadding:0.0f];
}