Storyboard segue 显示从底部垂直而不是水平的过渡 [英] Storyboard segue Show Transition vertical from bottom instead of horizontal

查看:33
本文介绍了Storyboard segue 显示从底部垂直而不是水平的过渡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基本的故事板设置,可以通过单击按钮在某些视图控制器之间进行过渡.我还在故事板的根部有一个导航控制器,希望这个转场链的执行方式类似于一系列推送过去的工作方式.功能就在那里,导航栏控制也是如此,但是过渡都有新的视图从底部进入并向上滑动,Cover Vertical.

I've got a basic storyboard setup that segue transitions through some view controllers by clicking a button. I've also got a Navigation controller at the root of the storyboard, hoping this segue chain performs similarly to how a series of Pushes used to work. The functionality is all there, as is the navigation bar controlling, however the transitions all have the new views coming in from the bottom and sliding up, Cover Vertical.

如何将其配置为像 [已弃用] 推送样式导航那样从右侧滑入?它甚至可能曾经在这里这样做过,但我似乎无法再让它这样做了.

How do I configure this to slide in from the right side like the [deprecated] Push style navigation does? It may have even used to do it here, but I can't seem to get it to do it anymore.

推荐答案

自行解决:

有趣的是,在第一个 prepareForSegue 期间有一些有问题的代码导致 navigationController 变为 nil.我删除了代码,但为了将来参考——如果你的 self.navigationController 变为 nil,那么 Segues 将垂直.如果它完好无损,它们将是水平的.

Interestingly enough, there was some questionable code during the first prepareForSegue that caused the navigationController to turn to nil. I removed the code, but for future reference-- if your self.navigationController turns nil then Segues will go vertical. If it is intact, they will be horizontal.

此外,虽然 segue 声称推"动作已被弃用,但在代码中使用它而不是 presentViewController 仍将使用水平滑动,而代码中的 presentViewController 是垂直的.很高兴知道.

Also, while the segue claims "Push" action is deprecated, using it in code instead of presentViewController will still use the horizontal slide, while the presentViewController in code is vertical. Good to know.

这篇关于Storyboard segue 显示从底部垂直而不是水平的过渡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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