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的页面。

    
    
    版权声明:欢迎转载,请注明出处:蜗牛爱课 • 移动互联网
  • 相关阅读:
    【nodejs】使用Node.js实现REST Client调用REST API
    [Groovy] Groovy && JNI
    一些很实用的Maven Plugins
    秋天到了
    今天头好疼
    想起那个人的时候
    不知道标题
    生活让我懂得
    显示实现接口和实现接口
    Foreach原理
  • 原文地址:https://www.cnblogs.com/56ik/p/5154960.html
Copyright © 2011-2022 走看看