zoukankan      html  css  js  c++  java
  • present半透明UIViewController

    present一个半透明的UIViewController,跟add个view差不多的意思,一般会遇到的问题是跳转到下一个页面加载完背景色又变回去了,没有半透明的效果,加上一句代码就好了。

    1,present 一个UIViewController

    SecondViewController *secondVC = [[SecondViewController alloc]init];
                secondVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
                [self.navigationController presentViewController:secondVC animated:YES completion:^{
                    
                }];

    2,present 一个UINavigationController,注意修改的是UINavigationController的modalPresentationStyle。

    SecondViewController *secondVC = [[SecondViewController alloc]init];
                UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:secondVC];
                nav.modalPresentationStyle = UIModalPresentationOverCurrentContext;
                [self.navigationController presentViewController:nav animated:YES completion:^{
                    
                }];
  • 相关阅读:
    使用git管理github项目
    router 跳转页面
    JS中[object object]怎么取值
    微信授权获取code
    闭包
    css属性clear
    javaScript循环
    css属性position
    跨域
    浅析JS内存 一
  • 原文地址:https://www.cnblogs.com/lilufeng/p/5050362.html
Copyright © 2011-2022 走看看