Reputation: 2625
I am coding an iPhone App in which am using a UITableView which has several sections ; each section has a header & then its rows like this:
I can do the row styles correctly, by using custom UITableViewCell objects, but how do I do the header? As you can see:
how do I achieve this, either programmatically or using Storyboard?
Upvotes: 0
Views: 446
Reputation: 12842
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
This method, implemented as part of your UITableViewDelegate, is intended to allow you to to create custom views for headers in UITableViews. You can return any UIView from that method, whether it's one that you want to create in Interface Builder, or in code.
Upvotes: 4