Imagine a table ("StyleGrouped") with multiple sections:
Intuitively, in order to define the section titles, I would use:
(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
And in order to simulate the buttons, I would create custom UIViews via:
(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
The problem is that by the time you start using viewForHeaderInSection
, then titleForHeaderInSection
stops working...
It makes sense somehow since we're now supposed to provide custom header views. The only problem is that there is no way to access the original UIView used by UIKit to render "regular header titles"...
Not the end of the world (i.e. creating your own UILabel and simulating the UIKit look & feel) but I'm just wondering if I missed something (?)
It appears that viewForHeaderInSection gets called before titleForHeaderInSection. However if you do return nil for a specific row where you don't want to use a view, the titleForHeaderInSection is called.
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