How to scroll the header along with the UITableView?
create sectionHeader view in a new method and then add to the end:
self.tableView.tableHeaderView = sectionHeader;
That behavior is only common when the UITableViewStyle
property of the table is set to UITableViewStylePlain
. If you have it set to UITableViewStyleGrouped
, the headers will scroll up with the cells.
This answer is taken from this question.
This solution works regardless of the number of headers.