首页 > 移动平台 > 详细

iOS Tableview点击cell 会往上跳

时间:2018-10-20 00:31:46      阅读:277      评论:0      收藏:0      [点我收藏+]

原因:
UITableview有个估算行高功能,如果没有设置tableView.estimatedRowHeight = 0,默认开启,默认高度是44,也就是如果你实际行高和44偏差很大的话,每次reloadData就会先根据估算行高进行刷新然后再走heightForRow去获取真正高度,就会视觉上就会产生跳一下的感觉,tableView.estimatedRowHeight = 0设置为0关闭这个功能就行了 
 
解决办法一:刷新单个cell
 
解决办法二:
self.tableView.estimatedRowHeight = 0
self.tableView.estimatedSectionHeaderHeight = 0
self.tableView.estimatedSectionFooterHeight = 0

 

 

iOS Tableview点击cell 会往上跳

原文:https://www.cnblogs.com/10-19-92/p/9819954.html

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