代码如下:
[self.headerViewsetNeedsLayout];
[self.headerViewlayoutIfNeeded];
CGFloat height = [self.headerViewsystemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height + self.headerView.frame.origin.y;
CGRectheaderFrame =self.headerView.frame;
headerFrame.size.height= height;
self.headerView.frame= headerFrame;
[self.tableViewbeginUpdates];
self.tableView.tableHeaderView=self.headerView;
[self.tableViewendUpdates];
网友评论