• modalPresentationStyle 使用present跳转界面时,实现特殊的弹出效果。


    1.代码如下

    controller.modalPresentationStyle=UIModalPresentationFormSheet;
    [self presentModalViewController:controller animated:YES]; 

    2.

    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。

  • 相关阅读:
    Python基础之只接收关键字参数的函数
    Python基础之可接受任意数量参数的函数
    Django基础之创建admin账号
    GIT版本控制工具
    全站导航
    python中对url编码解码处理
    VUE安装及初始化报错解决办法
    使用Appium+python爬取手机App
    python发送QQ邮件
    docker部署flask项目
  • 原文地址:https://www.cnblogs.com/liujxbky/p/7409945.html
Copyright © 2020-2023  润新知