首页 > 移动平台 > 详细

iOS TableView reloadData刷新列表cell乱跳、tableview闪动的问题。

时间:2018-09-11 15:30:59      阅读:876      评论:0      收藏:0      [点我收藏+]

解决方法:

在iOS 11Self-Sizing自动打开后,contentSize和contentOffset都可能发生改变。可以通过以下方式禁用

 self.estimatedRowHeight = 0;
self.estimatedSectionHeaderHeight = 0;

self.estimatedSectionFooterHeight = 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);

iOS TableView reloadData刷新列表cell乱跳、tableview闪动的问题。

原文:https://www.cnblogs.com/ruixin-jia/p/9627682.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!