美文网首页
iOS 11 tableview 刷新闪动

iOS 11 tableview 刷新闪动

作者: eagleyz | 来源:发表于2017-11-16 10:52 被阅读482次

IOS11以后,Self-Sizing默认开启,包括Headers, footers。如果项目中没使用estimatedRowHeight属性,在IOS11下会有奇奇怪怪的现象,因为IOS11之前,estimatedRowHeight默认为0,Self-Sizing自动打开后,contentSize和contentOffset都可能发生改变。
所以可以通过以下方式禁用:

self.tableView.estimatedRowHeight = 0;
self.tableView.estimatedSectionHeaderHeight = 0;
self.tableView.estimatedSectionFooterHeight = 0;
这样就解决tableview 滚动跳动问题了

相关文章

网友评论

      本文标题:iOS 11 tableview 刷新闪动

      本文链接:https://www.haomeiwen.com/subject/yfqlvxtx.html