zoukankan      html  css  js  c++  java
  • present一个半透明的ViewController的方法

    RecommandViewController *recommandVC = [[RecommandViewController alloc]init];
        if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0){
            recommandVC.modalPresentationStyle=
            UIModalPresentationOverCurrentContext|UIModalPresentationFullScreen;//if the controller has container like navigationcontroller or tababr controlelr,if you don`t use the UIModalPresentationFullScreen the bar will cover the viewcontroller
            [FindAppDelegate().window.rootViewController presentViewController:recommandVC animated:NO completion:^{
                recommandVC.view.backgroundColor=[UIColor clearColor];//you can figure any transparent here
            }];
        }else{
            FindAppDelegate().window.rootViewController.modalPresentationStyle=
            UIModalPresentationCurrentContext|UIModalPresentationFullScreen;//you must use the rootViewController if the system version under the iso 8.0 or the background will be black
            [FindAppDelegate().window.rootViewController presentViewController:recommandVC animated:YES completion:^{
                recommandVC.view.backgroundColor=[UIColor clearColor];
            }];
        }

    主要代码:

    vc.modalPresentationStyle = UIModalPresentationCustom;
  • 相关阅读:
    数据库连接池技术
    选择存储引擎的基本原则
    建索引原则
    数据库应用优化
    PDO
    关于cookie和session
    php常见漏洞及分析
    随便写
    spring 注入
    idea导入eclipse项目
  • 原文地址:https://www.cnblogs.com/weiboyuan/p/5203452.html
Copyright © 2011-2022 走看看