presentViewController 动画处理
来源:互联网 发布:美国9月非农数据 编辑:程序博客网 时间:2024/06/08 14:16
一、主要用途
弹出模态ViewController是IOS变成中很有用的一个技术,UIKit提供的一些专门用于模态显示的ViewController,如UIImagePickerController等。弹出模态ViewController主要使用于一下这几种情形:
1、收集用户输入信息
2、临时呈现一些内容
3、临时改变工作模式
4、相应设备方向变化(用于针对不同方向分别是想两个ViewController的情况)
5、显示一个新的view层级
这几种情形都会暂时中断程序正常的执行流程,主要作用是收集或者显示一些信息。
二、几个概念和常用设置
1、presenting view controller Vs presented view controller
当我们在view controller A中模态显示view controller B的时候,A就充当presenting view controller(弹出VC),而B就是presented view controller(被弹出VC)。官方文档建议这两者之间通过delegate实现交互,如果使用过UIImagePickerController从系统相册选取照片或者拍照,我们可以发现imagePickerController和弹出它的VC之间就是通过UIImagePickerControllerD
2、Modal Presentation Styles(弹出风格)
通过设置presenting VC的modalPresentationStyle属性,我们可以设置弹出View Controller时的风格,有以下四种风格,其定义如下:
typedef enum { UIModalPresentationFullS UIModalPresentationFullS
UIModalPresentationPageS
UIModalPresentationFormS
UIModalPresentationCurre
这四种方式在iPad上面统统有效,但在iPhone和iPod touch上面系统始终已UIModalPresentationFullS
3、Modal Transition Style(弹出时的动画风格)
通过设置设置presenting VC的modalTransitionStyle属性,我们可以设置弹出presented VC时场景切换动画的风格,其定义如下:
typedef enum { UIModalTransitionStyleCo我们可以看到有从底部滑入,水平翻转进入,交叉溶解以及翻页这四种风格可选。这四种风格在不受设备的限制,即不管是iPhone还是iPad都会根据我们指定的风格显示转场效果。
4、Dismiss Modal ViewController(消失弹出的VC)
消失presented VC,我们可以通过调用以下两个函数中的任何一个来完成
dismissModalViewControll 谁来调用这消失presented VC的这个方法:正确的做法是“谁污染谁治理”,即presenting VC调用上面的方法来取消presented VC的显示。这样做有一个好处,如果一个VC真不用户做的不同选择可能弹出不同的view controller,当不再需要显示被弹出的view controller的时候,直接调用[self
文章来源:http://blog.sina.com.cn/s/blog_8c19c6900101bugb.html
- presentViewController 动画处理
- presentviewcontroller 动画
- presentViewController view循环动画
- PresentViewController动画转场
- presentViewController跳转动画切换
- presentViewController
- presentViewController
- presentViewController
- PresentViewController
- PresentViewController
- 【转】自定义presentviewcontroller和pushviewcontroller转场动画
- 自定义presentViewController的转场动画(Swift)
- iOS 自定义presentViewController 动画时 出现的问题
- PresentViewController详解
- android动画效果处理
- 动画处理 core
- UIImageView 处理动画
- 粒子动画处理
- android 设备在linux(ubuntu) 下无法被adb device发现 解决方法
- JDK与JRE
- view视图的一些理解
- 利用mount命令将另外一个linux服务器上的目录挂在到本机
- android工具类LogUtil
- presentViewController 动画处理
- 还有着一个特殊的孔洞,这是专门投入药材的地方
- 解析Linux操作系统文件目录
- 第三方ROM福音 OPPO开放Find 5源代码
- CC2430的串口的位置1或2选择问题
- 学习stm32f107vc芯片的开发板
- Android adb.exe程序启动不起来
- IE6 下js报缺少各种 [标示符、字符、数字]异常信息
- s5pv210 uboot 源码分析 笔记版 转载请注明出处---crosskernel@gmail.com