I have a UITableView
with a header. the problem I currently have is that the header doesn\'t scroll with the table. I need it to scroll off screen (above) when the
If you write tableView.tableHeaderView = sectionHeader
you will lose the actual table view header.
If you want to have table view header along with section headers you have to set UITableViewStyle
property to UITableViewStyleGrouped
.
Also if you want to calculate section header height automatically you can return UITableViewAutomaticDimension
in heightForHeaderInSection
method like this:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return UITableViewAutomaticDimension;
}