`

iOS开发基础:Modal View Controller的不同呈现方式

阅读更多

ModalViewController可以有不同的呈现方式(modalPresentationStyle),在ipad下要提供多方向支持时,就要注意可能要改变ModalViewController的呈现方式,列举如下:
  

       UIModalPresentationFullScreen:全屏模式,即弹出窗口占满整个屏幕,在portrait模式和landscape模式下都一样,
  UIModalPresentationFormSheet:会将窗口缩小,使之居于屏幕中间,在portrait和landscape下都一样,但要注意landscape下如果软键盘出现,窗口位置会调整。

  UIModalPresentationPageSheet:比较给力的一种模式,在portrait时是FullScreen,在 landscape时和FormSheet模式有点像(上下没有留出空间),注意有这种需求的朋友直接用这种模式就可以了,不要想着自己编程去在 FullScreen和FormSheet去切换,很麻烦


  UIModalPresentationCurrentContext:(有空再补充)


  例子:
  ControllerA.modalPresentationStyle = UIModalPresentationPageSheet;
  [self presentModalViewController:ControllerA animated:YES];

分享到:
评论

相关推荐

    iOS app嵌入H5页面的通用模版

    1、解决的问题:Avoiding iOS bug:UIWebView with file input doesn‘t work in modal view controller 2、解决思路:使dismissViewControllerAnimated调用一次,或者让UIDocumentMenuViewController找不到...

    Semi Modal View Controller(iPhone源代码)

    来源:Licence:MIT平台:iOS设备:iPhone / iPad作者:Kent Nguyen  自定义modal view,包括...当modalview弹出的时候,主页面会缩小,并且变淡。支持ARC。 Code4App编译测试,适用环境:Xcode 4.3, iOS 5.0。

    史上最全的ios开发源码

    弹出视图类--Blur ModalView 弹出视图类--Depth View 弹出视图类--FWTPopover 弹出视图类--icon sheet 弹出视图类--Informatic Toolbar 弹出视图类--WCAlertView 弹出视图之Depth Modal 弹出视图之...

    iOS 人机交互指南(iOS Human Interface Guidelines)

    Container View Controller 123 Alerts, Action Sheets, and Modal Views 123 Alert 123 Action Sheet 127 Modal View 130 Controls 133 Activity Indicator 133 Date and Time Picker 133 Detail Disclosure Button...

    iOS开发中的ViewController转场切换效果实现简介

    在iOS7之前,View Controller的切换主要有4种: Push/Pop,...iOS5,调用- (void)transitionFromViewController:(UIViewController *)fromViewController toViewController:(UIViewController *)to

    Learning iOS Programming, 2nd Edition.pdf

    simple two-screen views, single-screen tabbed views, modal view controllers, and a view controller for selecting video and images. Chapter 7, Connecting to the Network This chapter discusses ...

    DMCustomModalViewController(iPhone源代码)

    来源:Licence:MIT平台:iOS设备:iPhone / iPad作者:Thomas Ricouard ...非全屏的modal view,可以通过往下拖动modal view来使其隐藏。 [优才 · Code4App]编译测试,适用环境:Xcode 4.5, iOS 5.0。

    ModalViewDemo

    使用presentModalViewController将栈中有ViewController的NavigationController弹出,

    iOS实现转场动画的3种方法示例

    在 NavigationController 里 push 或 pop 一个 View Controller,在 TabBarController 中切换到其他 View Controller,以 Modal 方式显示另外一个 View Controller,这些都是 View Controller Transition。...

    可看网站模态视图控制器

    可支持看网站模态视图控制器,源码TOWebViewController,TOWebViewController是一个允许用户在应用内快速查看...A modal view controller for iOS that allows users to quickly view web sites from within an app.

    模态视图控制器效果

    模态视图控制器效果,AFBlurSegue是一个自定义UIStoryboardSegue实现,它会自动...测试环境:Xcode 5.0,iOS 7.0以上Custom UIStoryboardSegue implementation for blurring the background of a modal view controller

    类似模态视图的多种效果

    源码MaryPopin,MaryPopin实现了类似模态视图的多种效果,但相比网上其他项目而言有更多选择的余地。...Category to display modal-like view controllers with more options http://backelite.github.io/MaryPopin/

Global site tag (gtag.js) - Google Analytics