Tencent / QMUI_iOS

QMUI iOS——致力于提高项目 UI 开发效率的解决方案
http://qmuiteam.com/ios
Other
7.08k stars 1.38k forks source link

[UIKit Bug] 将 UISearchBar 作为 tableHeaderView 使用的 UITableView,在 tableView 尚未添加到 window 上就同时进行了 setTableHeaderView、reloadData 的操作,会导致滚动异常 #1215

Closed MoLice closed 3 years ago

MoLice commented 3 years ago

Bug 表现 问题的表现同 #1161,不一样的是触发条件。

  1. 在一个 UIViewController 里自己创建 UITableView 并添加到 self.view 上(和系统的 UITableViewController 区分开)
  2. 不管 tableView 是否开启 estimatedRowHeight
  3. 在 viewDidLoad 里(也即 self.tableView.window 为 nil 时)调用 [tableView reloadData]

经过以上步骤后,列表的 contentSize 出错,表现出滚动异常。

以下是测试 Demo: TestTableViewContentSize.zip

其他信息

MoLice commented 3 years ago

已发布 4.2.3 修复该问题。