Reputation: 21164
I want to use a tableHeaderView that is dynamic in which the content can be added when certain action occurs or removed as well. The header frame should respond to the change and resize it but I cant seem to find solution to this. When I add content or remove content from tableHeaderView, I cannot change the frame size of header view of the table and so the cells look odd.
Is there a way to do this ?
Upvotes: 0
Views: 436
Reputation: 540105
I got this working by re-assigning the tableHeaderView
property of the table view after modifying the table header:
UIView *header = self.tableView.tableHeaderView;
// add/remove contents, set header.frame, ...
self.tableView.tableHeaderView = header;
Upvotes: 3