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同理