简体   繁体   English

如何在Xcode 4.2中更改模态的Storyboard动画?

[英]How can I change the Storyboard animation for modal in Xcode 4.2?

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. 我是Xcode编码的新手,我一直在使用Storyboard,如果你知道什么时候将一个按钮链接到视图并选择“模态”选项,它将链接到新视图的动画来自底端。 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. 对不起,这个问题非常简短,如果您需要更多信息,请问我。

Thanks. 谢谢。

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. 如果选择segue并查看Attributes Inspector(在窗口右侧),您将看到一个标记为Transition的弹出菜单。 This menu lists the available transition styles for the segue: 此菜单列出了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. 如果您想要一种不同的过渡方式,则需要使用不同类型的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. 如果你有一个托管源视图控制器的UINavigationController (包含按钮的那个),你可以使用Push segue,它从右边滑动新视图。 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. 如果您没有导航控制器或不喜欢Push segue动画,则必须实现自定义segue来更改动画。

More on custom segues 更多关于自定义segues

Custom Segue- Apple Custom Segue- Apple

Custom Segue + CATransition 自定义Segue + CATransition

-anoop -anoop

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

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