首页 > 其他 > 详细

TableView reloadData后contentSize不准确

时间:2019-05-29 14:46:36      阅读:404      评论:0      收藏:0      [点我收藏+]

原因 UITableView 的 Self-Sizing。及自动计算属性

 

在iOS11之前Self-Sizing默认是关闭的而在之后默认使用Self-Sizing.

 

为了性能,使用estimated而不是准确的的值来确定contentsize。因此在estimatedRowHeight, estimatedSectionHeaderHeight,estimatedSectionFooterHeight由0变为了UITableViewAutomaticDimension高度后,contentSize 出现了偏差。

 

解决方案 设置 estimatedRowHeight, estimatedSectionHeaderHeight, estimatedSectionFooterHeight 为0.

 

使用Runtime全局替换方案:

https://blog.csdn.net/Nathan1987_/article/details/78432585

TableView reloadData后contentSize不准确

原文:https://www.cnblogs.com/jisa/p/10943680.html

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