[英]UITableview scrolling to top after popViewControllerAnimated is called
I am having an issue with an UITableView
. 我在UITableView
上遇到问题。
I am displaying a collection of tracking records. 我正在显示跟踪记录的集合。 After the user taps on a cell, a detail view controller is displayed with detailed data. 用户点击单元格后,将显示包含详细数据的详细视图控制器。 My problem is after I call popViewControllerAnimated:YES
from the Detail view controller, my table view is reseted and scrolls to the top position automatically. 我的问题是从“详细信息”视图控制器调用popViewControllerAnimated:YES
后,我的表视图被重置并自动滚动到顶部位置。
I am not calling [myTable reloadData];
我没有打电话给[myTable reloadData];
on viewWillAppear
and I find this behavior kinda strange. 在viewWillAppear
,我发现这种行为有点奇怪。
Does anyone have an idea what I might be missing here? 有人知道我在这里可能会错过什么吗?
Any help or tip would be appreciated! 任何帮助或提示将不胜感激!
Thanks, Granit 谢谢,Granit
It's a known issue. 这是一个已知问题。
The more the estimatedRowHeight
differs from the actual height, the more the table will jump when the push segue happens. estimatedRowHeight
高度与实际高度之间的差异越大,在进行推挤操作时桌子将跳得越多。 The easiest workaround is to use a much better estimate. 最简单的解决方法是使用更好的估计。
if you don't call reloadData then either you re-add the table somewhere or you popped ViewController was reloaded because of some reason. 如果不调用reloadData,则可以在某个地方重新添加表,或者由于某种原因弹出ViewController重新加载。 Does ViewDidLoad called when you pop back? 弹出时是否调用ViewDidLoad?
How about storing the table scrolling state? 如何存储表格的滚动状态? (contentOffset) (contentOffset)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.