模态视图的概念以及显示、变换方式介绍
2014-05-29 09:57
369 查看
学几个单词
dissolve [dɪ'zɒlv] vi.溶解;解散
curl [kɜːl] vi.
卷曲
什么是模态视图?
比如UIAlertView,它就是一个模态视图。对于模态视图和普通视图最主要的区别就是模态视图显示的时候不能对其他视图进行操作。主要用来收集或显示一些信息。
思考:弹出警告框的时候,背景视图变暗不能操作,所以说警告框就是一个模态视图。
PresentationStyle(显示方式)
对于iPhone来讲PresentationStyle始终是UIModalPresentationFullScreen模式显示ModelViewController
对于iPad有四种显示方式,如下所示(默认全屏)
typedefenum {
UIModalPresentationFullScreen = 0,
UIModalPresentationPageSheet,
UIModalPresentationFormSheet,
UIModalPresentationCurrentContext,
} UIModalPresentationStyle;
UIModelPresentationFullScreen弹出VC时,被弹出的视图(presentedVC)充满全屏
UIModalPresentationPageSheet弹出VC时,presentedVC的height、width和presenting
VC相同,竖屏时和UIModelPresentationFullScreen相同,横屏时未覆盖区域变暗并阻止用户点击
UIModelPresentationFromSheet弹出VC时,presentedVC的height、width均会小于presentingVC,且presented居中显示,四周变暗
UIModalPresentationCurrentContext弹出VC时,和presentedVC的弹出方式相同
TransitionStyle(变换效果)
默认的presented方式是CoverVertical(竖直覆盖),也可以设置水平翻转、交叉溶解、翻页等效果
typedefenum {
UIModalTransitionStyleCoverVertical = 0,
UIModalTransitionStyleFlipHorizontal,
UIModalTransitionStyleCrossDissolve,
UIModalTransitionStylePartialCurl,
} UIModalTransitionStyle;
Delegate & Dismiss
ModalViewController
dismissViewControllerAnimated:completion,对于这个方法的调用者最简单的是[selfdismissViewControllerAnimated:completion],如果presentedVC和presenting
VC之间有数据传递的话,建议在presentedVC中使用代理方法dissmiss掉presented
VC
dissolve [dɪ'zɒlv] vi.溶解;解散
curl [kɜːl] vi.
卷曲
什么是模态视图?
比如UIAlertView,它就是一个模态视图。对于模态视图和普通视图最主要的区别就是模态视图显示的时候不能对其他视图进行操作。主要用来收集或显示一些信息。
思考:弹出警告框的时候,背景视图变暗不能操作,所以说警告框就是一个模态视图。
PresentationStyle(显示方式)
对于iPhone来讲PresentationStyle始终是UIModalPresentationFullScreen模式显示ModelViewController
对于iPad有四种显示方式,如下所示(默认全屏)
typedefenum {
UIModalPresentationFullScreen = 0,
UIModalPresentationPageSheet,
UIModalPresentationFormSheet,
UIModalPresentationCurrentContext,
} UIModalPresentationStyle;
UIModelPresentationFullScreen弹出VC时,被弹出的视图(presentedVC)充满全屏
UIModalPresentationPageSheet弹出VC时,presentedVC的height、width和presenting
VC相同,竖屏时和UIModelPresentationFullScreen相同,横屏时未覆盖区域变暗并阻止用户点击
UIModelPresentationFromSheet弹出VC时,presentedVC的height、width均会小于presentingVC,且presented居中显示,四周变暗
UIModalPresentationCurrentContext弹出VC时,和presentedVC的弹出方式相同
TransitionStyle(变换效果)
默认的presented方式是CoverVertical(竖直覆盖),也可以设置水平翻转、交叉溶解、翻页等效果
typedefenum {
UIModalTransitionStyleCoverVertical = 0,
UIModalTransitionStyleFlipHorizontal,
UIModalTransitionStyleCrossDissolve,
UIModalTransitionStylePartialCurl,
} UIModalTransitionStyle;
Delegate & Dismiss
ModalViewController
dismissViewControllerAnimated:completion,对于这个方法的调用者最简单的是[selfdismissViewControllerAnimated:completion],如果presentedVC和presenting
VC之间有数据传递的话,建议在presentedVC中使用代理方法dissmiss掉presented
VC
相关文章推荐
- ThickBox学习之一 ThickBox介绍以及单图片显示示例
- springframework(八)AOP的相关术语以及实现方式介绍
- Win form 在pictureBox控件中实现选择图片然后以二进制方式保存到数据库。以及在pictureBox控件显示出来
- c#自定义类型的转换方式operator,以及implicit(隐式)和explicit (显示)声明的区别
- Android ImageSwitcher、TextSwitcher以及以比较节省资源的方式显示jpg图片小例子
- IE Web Control介绍以及TreeView 控件树形结构不能显示的问题
- [Win8]Windows8开发笔记(四):画刷介绍以及如何实现实现歌词动态变色显示
- PHP 显示页面以及数据库中出现乱码问题的解决方式
- Moss/Sharepoint 为特定用户组设置特定视图以及可见视图,自定义列表新建页,修改页和显示页(无代码法)
- 使用Asp.net Mvc3 Razor视图方式扩展JQuery UI Widgets方法介绍
- PowerDesigner实用功能介绍1—设置视图显示列
- Android的intent:基础概念以及显示/隐式使用Intent && 通过intent返回结果
- 以Ajax方式显示Lotus Notes视图的javasript类库----NotesView2
- 以Ajax方式显示Lotus Notes视图的javasript类库----NotesView2
- 介绍NPTL (经典--诠释了线程的概念,以及linux调度单位)
- 以Ajax方式显示Lotus Notes视图的javasript类库----NotesView2
- 用C语言写的ISAPI上传文件(图片)、显示图片、图片存储以及可供其它语言调用的方式、和程序源代码
- VC工作区类视图中的信息错误的解决以及VC编译器产生的文件介绍
- ArcGIS表关联方式介绍(二)-ArcSDE视图、QueryLayer、RelationshipClass
- 重温傅里叶--深入篇1--傅里叶级数与傅里叶变换的关系以及频谱图的介绍