首页 > 其他 > 详细

present半透明UIViewController

时间:2015-12-21 15:52:19      阅读:230      评论:0      收藏:0      [点我收藏+]

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:^{
                
            }];

 

present半透明UIViewController

原文:http://www.cnblogs.com/lilufeng/p/5050362.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!