iosuitableviewheightsectionheader

Different height for section header UITableView


I have some issue with section header height, so:

In storyboard I defined prototype and I assigned it to the section header view, in Size Inspector with height "100", but I also created a method "heightForHeaderInSection" where I set "90".

The result is that simulator draws section with height 90, but when I call "self.tableView.sectionHeaderHeight" it gives me 100.

How can I get height from "heightForHeaderInSection" with 90 value programmatically?


Solution

  • Try this

    CGFloat headerViewHeight = [self.tableView headerViewForSection:0].frame.size.height;