UINavigationItem Prompt Animation Issue

时间:2016-04-04 16:34:23

标签: uinavigationitem

I have two UITableViewControllers that are connected via a Show segue. The prompt property of UINavigationItem is set on both view controllers in Interface Builder. When the first view controller is shown, the prompt and navigation bar are both displayed properly, however, when performing a segue to the second view controller, the title and the back button animate undesirably. I have tried setting the prompts programmatically in the viewWillLayoutSubviews, viewDidLayoutSubviews, viewDidLoad, viewWillAppear:, and the viewDidAppear: methods of both view controllers, but I get the same effect.

Any ideas on how to resolve this issue? I don't want to resort to a custom view for the titleView because I prefer the stock functionality, but I am not able to figure out how to fix the undesirable animation.

Here is a video if the animation in question.

1 个答案:

答案 0 :(得分:0)

嗯,看起来这是显示下一个视图控制器时UINavigationItem布局方式的问题。

根据问Catalina T.中的answer类似问题,进行两次调用,将导航栏的hidden属性设置为true,然后再设置为{{在false中的1}}似乎可以解决这个问题。