iOS 8 UITableView单元格在选中时会跳转

时间:2015-02-01 03:17:57

标签: ios uitableview swift ios8

我有一个非常标准的UITableView,它使用自动调整大小的单元格

// Set the height of the table view cells
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 44.0;

当我将segue推送到新的视图控制器时,表视图跳转到不同的位置。我尝试过使用tableView方法估计了RowHeight,rowHeight,没有...

我已经阅读了这些内容,但仍然没有任何效果。任何人吗?

Table View Cells jump when selected on iOS 8

iOS 8 Auto cell height - didSelectRowAtIndexPath causes UItableview to jump to top

IOS 8 UITableView self-sizing cells jump/shift visually when a new view controller is pushed

1 个答案:

答案 0 :(得分:3)

这是一个众所周知的问题。

我相信你会发现estimatedRowHeight与实际高度的差异越大,推送segue发生时表格就越多。解决方法是使用更好的估计(或实现tableView:estimatedHeightForRowAtIndexPath:并返回确切的高度)。