问题描述
我在显示一个人的tableView的名单。在单击任何细胞,应用程序显示一个新的屏幕。当用户回来previous屏幕,的tableView应该会出现。在这里,当用户回来了的tableView筛选,我呼叫服务器API来获取人的更新列表,并重新装载表来显示它们。
当用户回来的屏幕,显示的tableView,在的UITableViewCell
标签是动画一点点的问题是。这部动画是这样的标签,从下面的正确位置和动画向上一些的地方,它的正确位置移动。这个动画是不是由我执行,我也不想要它。其周边的0.5-1秒可见。
下面比较之前和之后的动画标签的位置。
有没有人遇到过这个?
注意: 请注意,我用自动布局。因为使用自动布局之前,这个问题是不存在这可能是一个问题。的
编辑:尝试禁用隐动画作为以下,但没有显示工作
的NSMutableDictionary * newActions = [[的NSMutableDictionary页头] initWithObjectsAndKeys:[NSNull空] @onOrderIn
[NSNull空] @onOrderOut
[NSNull空] @子层
[NSNull空] @内容,
[NSNull空] @界限,
零];
cell.textLabel.layer.actions = newActions;
cell.detailTextLabel.layer.actions = newActions;
cell.layer.actions = newActions;
cell.contentView.layer.actions = newActions;
解决这个问题。很抱歉打扰你们。它是如此愚蠢的。我被刷新表时用户来自下一个视图控制器后通过调用REST API,然后调用 displayTable
的方法从底部显示的表。
现在,我称之为 reloadData code>方法来刷新它,如果它已经显示出来,而不是调用
displayTable
。
I am displaying list of persons in a tableView. On clicking any of the cell, app displays a new screen. When user comes back to previous screen, a tableView should appear. Here, when user comes back to screen with tableView, I call server API to get updated list of people and reload table to display them.
The issue is when user comes back to screen and tableView is displayed, label in UITableViewCell
is animated a little bit. This animation is such that label moves from some place below its correct position and animation upwards to its correct position. This animation is not implemented by me, neither do I want it. Its visible for around 0.5-1 sec.
Compare below label's position before and after animation.
Has anyone experienced this?
Note : Note that I have used autolayout. Which might be an issue because before using autolayout this issue was not there.
Edit : Tried to disable implicit animation as shown below but not working.
NSMutableDictionary *newActions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:[NSNull null], @"onOrderIn",
[NSNull null], @"onOrderOut",
[NSNull null], @"sublayers",
[NSNull null], @"contents",
[NSNull null], @"bounds",
nil];
cell.textLabel.layer.actions = newActions;
cell.detailTextLabel.layer.actions = newActions;
cell.layer.actions = newActions;
cell.contentView.layer.actions = newActions;
Solved the issue. Sorry to bother you guys. It was so silly. I was refreshing the table when user comes back from next view controller by calling REST API and then calling a method displayTable
which displays a table from bottom.Now, I call reloadData
method to refresh it if its already displayed, instead of calling displayTable
.
这篇关于的UITableViewCell标签显示很少向上滑动动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!