简体   繁体   English

iOS开发:如何使视图向右过渡而不是默认向左过渡?

[英]iOS Development: How can I make my view transition to the right instead of to the default left?

I'm diving into iOS development and I was wondering if it's possible to make a view transition in from the left to the right. 我正在研究iOS开发,我想知道是否可以从左向右进行视图转换。 Similar to the transition that occurs when you pop a view controller off the nav stack, only I want the transition to occur when I push a view controller onto the stack. 类似于从导航堆栈弹出视图控制器时发生的过渡,只有当我将视图控制器推入堆栈时才希望发生过渡。 The solutions I've found on the net are difficult to follow as a newcomer and it looks like they're trying to accomplish more than what I'm trying to accomplish. 作为新手,我在网上找到的解决方案很难遵循,而且看起来他们正在尝试实现比我试图实现的目标更多的目标。

Thanks so much for your wisdom! 非常感谢您的智慧!

It's up to you to decide what kind of transition is best, depending on your application. 取决于您的应用程序,由您决定哪种过渡最好。 Just remember to follows the Human Interface Guidelines. 只要记住要遵守人机界面指南。 Anyway, you can easily accomplish this by using a CATransition . 无论如何,您可以使用CATransition轻松完成此CATransition Take a look at the documentation and download this Apple sample code, aptly named View Transitions to start with. 查看文档,然后下载此Apple示例代码,首先将其命名为View Transitions Note that this is not the way to go if you want to push a new controller on the stack: this is the way to transition between two arbitrary views. 请注意,如果要在堆栈上推送新的控制器,这不是可行的方法:这是在两个任意视图之间转换的方法。

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

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