简体   繁体   English

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

[英]iOS 8 UITableView cells jump when selected

I have a pretty standard UITableView that uses auto resizing cells 我有一个非常标准的UITableView,它使用自动调整大小的单元格

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

When I push segue to a new view controller, the table view jumps to a different position. 当我将segue推送到新的视图控制器时,表视图跳转到不同的位置。 I've tried estimatedRowHeight, rowHeight, using the tableView methods, and nothing... 我已经尝试了使用tableView方法的estimatedRowHeight,rowHeight,没有...

I've read these and nothing still really has worked. 我已经阅读了这些内容,但仍然没有任何效果。 Anyone? 任何人?

Table View Cells jump when selected on iOS 8 在iOS 8上选择时,表视图单元格跳转

iOS 8 Auto cell height - didSelectRowAtIndexPath causes UItableview to jump to top iOS 8自动单元格高度 - didSelectRowAtIndexPath导致UItableview跳转到顶部

IOS 8 UITableView self-sizing cells jump/shift visually when a new view controller is pushed 当按下新的视图控制器时,IOS 8 UITableView自调整单元格可视地跳转/移位

It's a known issue. 这是一个众所周知的问题。

I believe you'll find that the more the estimatedRowHeight differs from the actual height, the more the table will jump when the push segue happens. 我相信你会发现estimatedRowHeight与实际高度的差异越大,当推动segue发生时,表格会跳得越多。 The workaround is to use a much better estimate (or to implement tableView:estimatedHeightForRowAtIndexPath: and return the exact height). 解决方法是使用更好的估计(或实现tableView:estimatedHeightForRowAtIndexPath:并返回确切的高度)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM