To set the UIView for the section title, you use the function:
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;
I suspect that you are calling setContentOffset somewhere in viewWillAppear, but this function is being called later. And I think this overwrites your content .... not sure why this does not happen when animated - YES, but anyway just put your setContentOffset in this function like this:
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *headerView = nil; if (section == SEC_WITH_IMAGE_HEADER) { headerView = self.neededView; } [self.tableView setContentOffset:CGPointMake(0,48) animated:NO]; return headerView; }
Worked for me, hope it will be for someone else.
source share