如何在 Xcode 4.2 中更改模式的 Storyboard 动画?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8995163/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I change the Storyboard animation for modal in Xcode 4.2?
提问by rob mayoff
I am quite new to Xcode coding and I have been using Storyboard for along time, if you know when you link a button to a view and select the option "Modal" it will make a link with the animation of the new view coming up from the bottom. I was wondering if it was possible to change the animation to the new view coming from the right. I am sorry this question was so brief, if you need more info just ask me.
我对 Xcode 编码很陌生,我一直在使用 Storyboard,如果您知道何时将按钮链接到视图并选择“模态”选项,它将与来自新视图的动画建立链接底部。我想知道是否可以将动画更改为来自右侧的新视图。很抱歉这个问题太简短了,如果您需要更多信息,请询问我。
Thanks.
谢谢。
回答by rob mayoff
If you select the segue and look at the Attributes Inspector (on the right side of the window), you will see a pop-up menu labeled Transition. This menu lists the available transition styles for the segue:
如果您选择 segue 并查看 Attributes Inspector(在窗口右侧),您将看到一个标记为 Transition 的弹出菜单。此菜单列出了 segue 的可用过渡样式:
- Cover Vertical
- Flip Horizontal
- Cross Dissolve
- Partial Curl
- 封面垂直
- 水平翻转
- 交叉溶解
- 部分卷曲
If you want a different style of transition, you will need to use a different type of segue. If you have a UINavigationController
hosting your source view controller (the one that contains the button), you can use a Push segue, which slides the new view in from the right. If you don't have a navigation controller or don't like the Push segue animation, you'll have to implement a custom segue to change the animation.
如果您想要不同的过渡风格,则需要使用不同类型的转场。如果您有一个UINavigationController
托管源视图控制器(包含按钮的控制器),您可以使用 Push segue,从右侧滑入新视图。如果您没有导航控制器或不喜欢 Push segue 动画,则必须实现自定义 segue 来更改动画。
回答by anoop4real
More on custom segues
更多关于自定义转场
-anoop
-anoop