TableView刷新时候抖动问题
在iOS 11Self-Sizing自动打开后,contentSize和contentOffset都可能发生改变。可以通过以下方式禁用
self.XSTableView.estimatedRowHeight = 0;
self.XSTableView.estimatedSectionFooterHeight = 0;
self.XSTableView.estimatedSectionHeaderHeight = 0;
在iOS 10 以下 通过以下协议方法设置精准高度就可以了
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath*)indexPath NS_AVAILABLE_IOS(7_0);
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)section NS_AVAILABLE_IOS(7_0);
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForFooterInSection:(NSInteger)section NS_AVAILABLE_IOS(7_0);
本文标题:TableView刷新时候抖动问题
本文链接:https://www.haomeiwen.com/subject/zqfqjltx.html
网友评论