I am trying to implement a header view in my application and have the following code to create the header view:
(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *view = [[[NSBundle mainBundle] loadNibNamed:@"FutureAppointmentsHeaderView" owner:self options:nil] lastObject];
return view;
}
I have also set the height of the headerView as follows:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 70;
}
When the page loads, the header view is in the correct position (see first image). However when I scroll the header covers the other cells (see second picture.)
I can't what I am doing wrong to get this behaviour. Any help much appreciated.