iPhone: How to do a presentModalViewController animation from left to right(iPhone:如何从左到右做一个presentModalViewController动画)
问题描述
我正在展示一个带有动画的模型视图.默认情况下,它是从下到上的.如何使动画从左到右?我知道我可以使用导航控制器.但实际上呈现视图不需要导航栏,模态呈现视图也不需要导航栏.我仍然想要从左到右的过渡.
I am presenting a model view with animation. As a default it comes from bottom to top. How can I make the animation to go from left to right? I know I could use a navigation controller. But actually the presenting view does not need a navigation bar and also the modally presented view does not need a navigation bar. Still I want a transition from left to right.
推荐答案
UIModalTransitionStyle只有四个:
UIModalTransitionStyleCoverVertical
UIModalTransitionStyleFlipHorizontal
UIModalTransitionStyleCrossDissolve
UIModalTransitionStylePartialCurl
就像你说的,导航控制器会朝那个方向推进.如果您不想使用它,则必须自己为视图设置动画.
Like you said, a nav controller will push that way. If you don't want to use that, you'll have to animate the view yourself.
这篇关于iPhone:如何从左到右做一个presentModalViewController动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iPhone:如何从左到右做一个presentModalViewController动画
基础教程推荐
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
- UIImage 在开始时不适合 UIScrollView 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
- Play 商店的设备兼容性问题 2022-01-01
- Android Volley - 如何动画图像加载? 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
