视图以模态视图动画而非显示(推动)动画显示 [英] View appears with modal view animation instead of show (push) animation

查看:144
本文介绍了视图以模态视图动画而非显示(推动)动画显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将我的应用程序从iOS 8.3更新为iOS 9.
修复了代码中的各种错误后,我设法编译应用程序并运行它,当我发现以下问题时。

I've recently updated my app from iOS 8.3 to iOS 9. After fixing the various errors with the code, I managed to compile the app and run it, when I noticed the following problem.

当我执行segue点击(例如,UIButton)时,加载了segue的视图会显示模态视图的动画(从底部滑动到顶部),但是在故事板中,segue是显示(例如推送)。此外,导航控制器的后退按钮不再出现。

When I perform a segue clicking, for example, an UIButton, the view loaded with the segue appear with the animation of a modal view (sliding from bottom until it reaches top), but in the storyboard the segue is Show (e.g. Push). In addition, the back button from the navigation controller doesn't appear anymore.

当我执行segue时控制台打印出来:

The console print this when I perform a segue:


不允许在取消分配时尝试加载视图控制器的视图,并且可能导致未定义的行为(< UISearchController:0x7ffde14866b0>)

问题似乎只出现在一个视图中,当加载其他视图时,我试图设置其他视图作为初始视图控制器和所有工作。

The problem seems to be present only in a view, when loading other views, I tried to set other views as Initial View Controller and all works.

推荐答案

在看了项目中的故事板后,我发现了问题是因为每次推送segue后额外的导航控制器。也就是说,除了初始(根)导航控制器之外,Storyboard还包含一个 UINavigationController 作为有问题的Push segues的目标。删除这些额外的导航控制器(但保留根导航控制器)解决了这个问题。

After taking a look at the Storyboard in the project, I discovered that the problem was due to extra navigation controllers after each Push segue. That is, in addition to the initial (root) navigation controller, the Storyboard contained a UINavigationController as the destination for the problematic Push segues. Removing these extra navigation controllers (but keeping the root navigation controller) solved the problem.

这篇关于视图以模态视图动画而非显示(推动)动画显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆