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;
  • 相关阅读:
    常见问题
    查询
    多对多关系
    prototype & __proto__
    new operator
    用户
    express.Router
    Express 应用生成器
    LeanCloud
    npm常用命令
  • 原文地址:https://www.cnblogs.com/weiboyuan/p/5203452.html
Copyright © 2011-2022 走看看