How to resize a tableHeaderView of a UITableView?

FYI: I’ve gotten this to work by modifying the tableHeaderView and re-setting it. In this case, i’m adjusting the size of the tableHeaderView when the UIWebView subview has finished loading.

[webView sizeToFit];
CGRect newFrame = headerView.frame;
newFrame.size.height = newFrame.size.height + webView.frame.size.height;
headerView.frame = newFrame;
[self.tableView setTableHeaderView:headerView];

Leave a Comment