Storyboard segue Show Transition vertical from bottom instead of horizontal

狂风中的少年 提交于 2019-12-12 22:14:11

问题


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.


回答1:


Self answered fix:

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.

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.



来源:https://stackoverflow.com/questions/28071385/storyboard-segue-show-transition-vertical-from-bottom-instead-of-horizontal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!