简体   繁体   English

带有NavigationController的情节提要中两个视图之间的Segue / Transition

[英]Segue/Transition between two views in a storyboard w/o a NavigationController

Is it possible to not use a NavigationController and change views with an animation/segue with a storbyboard. 是否可以不使用NavigationController并使用storbyboard更改动画/ segue的视图。 I cant seem to figure out how to accomplish this. 我似乎无法弄清楚如何做到这一点。 I thought it would have been pretty simple but no luck. 我以为这很简单,但是没有运气。 I just have two views and want to transition without adding a navigationcontroller. 我只有两个视图,并且想要在不添加NavigationController的情况下进行过渡。

Sure, just create the segue and select "modal" in the menu that pops up instead of "push". 当然,只需创建segue,然后在弹出的菜单中选择“模式”即可,而不是“推送”。

When you want to return you do it programmatically with: 当您想退货时,可以通过以下方式进行编程:

    [self dismissModalViewControllerAnimated:YES];

TJ is right about selecting a modal segue, but -dismissModalViewControllerAnimated: is deprecated in iOS 5+. TJ在选择modal -dismissModalViewControllerAnimated:是正确的,但是-dismissModalViewControllerAnimated:在iOS 5+中已弃用。

You should use -dismissViewControllerAnimated:completion: instead. 您应该使用-dismissViewControllerAnimated:completion:代替。

With the advent of iOS 6, you may also be able to use 'unwind actions' for dismissing presented controllers with unwind segues. 随着iOS 6的问世,您也许还可以使用“展开动作”来消除显示的控制器的松散状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM