UIViewController的 modalPresentationStyle 用法
来源:互联网 发布:大数据 杂志 编辑:程序博客网 时间:2024/05/21 06:02
通过设置presenting VC的modalPresentationStyle属性,我们可以设置弹出View Controller时的风格,有以下四种风格,其定义如下:
typedef enum { UIModalPresentationFullScreen = 0, UIModalPresentationPageSheet, UIModalPresentationFormSheet, UIModalPresentationCurrentContext,} UIModalPresentationStyle;
UIModalPresentationFullScreen代表弹出VC时,presented VC充满全屏,如果弹出VC的wantsFullScreenLayout设置为YES的,则会填充到状态栏下边,否则不会填充到状态栏之下。
UIModalPresentationPageSheet代表弹出是弹出VC时,presented VC的高度和当前屏幕高度相同,宽度和竖屏模式下屏幕宽度相同,剩余未覆盖区域将会变暗并阻止用户点击,这种弹出模式下,竖屏时跟UIModalPresentationFullScreen的效果一样,横屏时候两边则会留下变暗的区域。
UIModalPresentationFormSheet这种模式下,presented VC的高度和宽度均会小于屏幕尺寸,presented VC居中显示,四周留下变暗区域。
UIModalPresentationCurrentContext这种模式下,presented VC的弹出方式和presenting VC的父VC的方式相同。
这四种方式在iPad上面统统有效,但在iPhone和iPod touch上面系统始终已UIModalPresentationFullScreen模式显示presented VC。
1 0
- UIViewController的 modalPresentationStyle 用法
- UIViewController的 modalPresentationStyle 用法
- UIViewController使用属性modalPresentationStyle
- 消失的控制器:modalPresentationStyle
- UIViewController 的addChildViewController:(UIViewController *) 方法
- iOS4.0开发——Modal a Controller的不同呈现类型modalPresentationStyle
- iOS4.0开发——Modal a Controller的不同呈现类型modalPresentationStyle
- UIViewController和UIViewController之间的交互
- UIViewController和UIViewController之间的交互
- UIViewController 推出另外一个半透明的UIViewController
- UIViewController present出来一个透明的UIViewController
- [iOS]modalPresentationStyle和modalTransitionStyle
- UIViewController的生命周期
- UIViewController的生命周期
- UIViewController的生命周期
- UIViewController的生命周期
- UIViewController的生命周期
- 对UIViewController的理解
- 解题报告 之 ZOJ2760 How Many Shortest Path
- 11gR2单机通过RMAN恢复到RAC
- GPU硬解码---CUVID
- 杭电5122
- 使用 PyInstaller 把python程序 .py转为 .exe 可执行程序
- UIViewController的 modalPresentationStyle 用法
- procedure_3
- angularJS学习
- 数据结构与算法--排序概述
- Mac黑魔法之小机器人工作流
- 高质量C/C++编程(三)
- freemarker静态化页面
- C#dll版本号默认生成规则
- 多重继承实例