zoukankan      html  css  js  c++  java
  • 蜗牛爱课 - iOS7、8模态半透明弹出框

    //源Controller中跳转方法实现  

     MKDialogController *controller = [[MKDialogController alloc] init];  

     controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;  // 跳转时的动画效果,可以修改

    if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {  

        controller.providesPresentationContextTransitionStyle = YES;  

       controller.definesPresentationContext = YES;  

      controller.modalPresentationStyle = UIModalPresentationOverCurrentContext;  

     [self presentViewController:controller animated:YES completion:nil];  

     } else {  

       self.view.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext;  

         [self presentViewController:controller animated:NO completion:nil];  

       self.view.window.rootViewController.modalPresentationStyle = UIModalPresentationFullScreen;  

    }  

    通过上面的方法模态出的新页面的self.view设置有透明的时候,就可以看到上一层controller的页面。

    
    
    版权声明:欢迎转载,请注明出处:蜗牛爱课 • 移动互联网
  • 相关阅读:
    听说,好久不更了......
    JavaScript中数组常用方法
    html5常用英语单词
    重写与重载的区别
    RelativeLayout以及ListView
    树莓派基础配置
    通过yum安装lnmp-phpmyadmin
    POJ1850
    基于字典序的组合生成算法
    全排序之字典排序
  • 原文地址:https://www.cnblogs.com/56ik/p/5154960.html
Copyright © 2011-2022 走看看