I've just noticed that in iOS 8, a tableview which is defined programmatically must define heightForHeaderInSection in addition of viewForHeaderInSection, otherwise the default height will be 0 and the sections headers won't appear. While in iOS 7 and under the sections header where appearing even if heightForHeaderInSection is not defined.
I wonder if somebody noticed the same behavior because it's not mentioned in the iOS 8 UITableView class reference
I can duplicate this issue, and can confirm the fix. My header views were not showing up at all. Implementing the following code fixed it (where 20 px is the desired header height).
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 20;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With