我在 StoryBoard 中为我的 tableViewCell 使用 autoLayout,因为我想根据文本为行设置可变高度。
现在在 viewDidLoad 中
我正在使用这些代码行
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 310;
现在,如果我滚动 tableView,然后重新加载它。它导致 tableView 设置它的偏移量(不知道为什么)。请在重新加载表格 View 后查看下图(图片上方的白色区域)。
最佳答案
在您的 viewDidLoad 中添加这段代码
self.automaticallyAdjustsScrollViewInsets = false;
关于ios - UITableView estimatedRowHeight 在重新加载时更改其偏移量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36031171/