How to animate UITableView header view

前端 未结 7 1423
旧巷少年郎
旧巷少年郎 2020-12-29 09:32

I need to animate the insertion of a tableview header view. I want that the table rows to slide down while the header view expands its frame.
So far the best result I go

相关标签:
7条回答
  • 2020-12-29 10:23

    The selected answer didn't work for me. Had to do the following:

    [UIView animateWithDuration: 0.5f
                     animations: ^{
                         CGRect frame = self.tableView.tableHeaderView.frame;
                         frame.size.height = self.headerViewController.preferredHeight;
                         self.tableView.tableHeaderView.frame = frame;
                         self.tableView.tableHeaderView = self.tableView.tableHeaderView;
                       }];
    

    The really peculiar part is that this works in one view but not in a subclass of the same view controller / view hierarchy.

    0 讨论(0)
提交回复
热议问题