ipad与iphone区别之一
2013-07-07 23:58
218 查看
2、Modal Presentation Styles(弹出风格)
通过设置presenting VC的modalPresentationStyle属性,我们可以设置弹出View Controller时的风格,有以下四种风格,其定义如下:
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。
通过设置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。
相关文章推荐
- iPhone与iPad在开发上的区别
- UIImagePickerController在iPhone和iPad上的区别
- iOS 对iphone和 ipad的摄像头和图片库的区别处理代码
- Iphone 和 Ipad 开发 区别
- UIImagePickerController在iPhone和iPad上的区别
- ipad开发开发之区别于iphone
- ipad开发开发之区别于iphone
- iphone 与 iPad在开发中的区别以及iPad中的UIPopoverController的使用
- iPhone与iPad开发的区别
- ipad开发开发之区别于iphone
- iphone和iPad开发的区别
- iphone和ipad的一些区别
- iPhone与iPad开发的区别
- ipod, iphone, ipad的区别
- iPad开发之区别与iPhone
- ipad开发开发之区别于iphone
- ipad开发开发之区别于iphone
- iOS中未越狱的iPhone、iPad通过网址实现一键安装ipa格式的APP应用
- ios(ipod touch&ipad&iphone)越狱后的工作
- iPhone、iPad强制关机