解决iOS11tableView:heightForHeaderInSection:方法不执行的问题

更新至iOS11后,真是一堆莫名其妙的BUG~ 蛋疼的厉害。。。

最近发现Group样式的TableView,怎么设置头部或底部高度都没用


- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {

return 10;

}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {

   return 10;

}

试了很多方法,终于找到解决问题,只要直接随便设置下面两个属性值后,上面两个方法就会响应啦


_tableView.sectionHeaderHeight = 0.01;

_tableView.sectionFooterHeight = 0.01;

你可能感兴趣的:(解决iOS11tableView:heightForHeaderInSection:方法不执行的问题)