iOS8以iOS8以下的系统present一个半透明的ViewController的方法
2016-02-15 14:53
691 查看
起因
需求需要做一个引导页面,这个引导页的逻辑处理较多,如果单独一个View,不方便管理与后期的维护,所以需要做成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]; }]; }
相关文章推荐
- iOS 整型转换警告"NSInteger' should not be used as format arguments; add an explicit cast to 'long' inste"
- ios开发证书变成证 “此证书的签发者无效了”
- iOS 7中自动布局教程
- iOS-关闭应用时想让应用直接退出的方法
- IOS开发证书显示“此证书的签发者无效”解决方法
- IOS开发证书显示“此证书的签发者无效”解决方法
- IOS开发证书变成“此证书的签发者无效”解决方法
- iOS 设置label的边距
- ios-此证书的签发者无效
- iOS开发证书变成“此证书的签发者无效”解决方法
- iOS IM开发准备工作(二)protobuf-objc安装及使用
- iOS中Block总结
- IOS开发证书变成“此证书的签发者无效”解决方法
- 002、iOS开发-NSLog不打印设置
- 此证书的签发者无效
- iOS开发 证书失效解决办法
- iOS 整体框架类图
- iOS 7 的多任务
- GitHub上排名前50的iOS项目:总有一款你用得着
- iOS 滤镜效果