Reputation: 668
I have set up a UITableViewController with a Container View as header view in Interface Builder. The header view has a height of 180px:
Unfortunately, at run-time the height of the Container View is just 116px:
If I replace the Container View in the table head with a standard view, say UILabel, the height of the header view I set in Interface Builder is correctly honoured. But this somehow doesn't work with Container Views.
Adjust Scroll View Insets doesn't help because it just moves the overflowing part of the image under the Navigation Bar, the height of the Container view is still wrong.
Any ideas? Thanks!
Upvotes: 1
Views: 770
Reputation: 2482
You should implement UITableViewDelegate
and declare the method
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 180;
}
Upvotes: 1