UITableView设置为Group样式。
不走heightForHeaderInSection/heightForFooterInSection方法。
1,对于没隐藏苹果原生的navigationBar的
iOS11默认开启Self-Sizing,关闭Self-Sizing即可。
self.tableView.estimatedRowHeight = 0;
self.tableView.estimatedSectionHeaderHeight = 0;
self.tableView.estimatedSectionFooterHeight = 0;
2,对于隐藏了苹果原生navigationBar,用UIView自己写navigationBar的
可能是没有实现tableView: viewForHeaderInSection:/tableView: viewForFooterInSection:造成的。
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 10;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
return [[UIView alloc] init];
}
//viewForFooterInSection同理