解决自动计算行高 UITableViewAutomaticDimension,UITableView上拉加载更多刷新跳动

正常情况下我们只要设置这三个刷新为零就可以了

 _tableView.estimatedRowHeight = 0;
 _tableView.estimatedSectionFooterHeight = 0;
 _tableView.estimatedSectionHeaderHeight = 0;

自动计算行高 ,那么estimatedRowHeight就必须不为0

  _tableView.rowHeight = UITableViewAutomaticDimension;
  _tableView.estimatedRowHeight = UITableViewAutomaticDimension;
  _tableView.estimatedSectionFooterHeight = 0;
  _tableView.estimatedSectionHeaderHeight = 0;

问题来啦,就是下拉加载更多的时候,列表从底部出现跳动的问题,此时只需要修改estimatedRowHeight的值

//ScreenHeight 屏幕的高度
 _tableView.estimatedRowHeight = ScreenHeight*2;

完美解决跳动问题,记录一下!当然,自己计算Cell的高度不会出现跳动问题

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容