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;
present一个半透明的ViewController的方法的更多相关文章
- 在iOS上present一个半透明的viewController
UIViewController *viewController = [[UIViewController alloc]init]; UIViewController* controller = se ...
- presentModalViewController方法,present一个透明的viewController,带动画效果
//假设需要被present的控制器实例为controller,controller的背景色设置为clearColor UIViewController * rootcontroller = self ...
- iOS连续dismiss几个ViewController的方法
原文链接:http://blog.csdn.net/longshihua/article/details/51282388 presentViewController是经常会用到的展现ViewCont ...
- Attempt to present <TestViewController2: 0x7fd7f8d10f30> on <ViewController: 0x7fd7f8c054c0> whose view is not in the window hierarchy!
当 storyboard里面的 按钮 即连接了 类文件里面的点击方法 又 连接了 storyboard里 另一个 控制器的 modal 就会出现类似Attempt to present & ...
- viewController启动方法分析
viewController启动方法分析 转载:http://blog.csdn.net/dizzthxl/article/details/14170047 首先理清楚一个概念: 创建一个类和实例化一 ...
- 错误:Warning: Attempt to present <UIAlertController: 0x7fd192806e20> on <ViewController: 0x7fd1928048d0> whose view is not in the window hierarchy!
系统:mac OS 10.12 (16A323) Xcod:8.3.3 错误:Warning: Attempt to present <UIAlertController: 0x7fd1928 ...
- Java中是否可以调用一个类中的main方法?
前几天面试的时候,被问到在Java中是否可以调用一个类中的main方法?回来测试了下,答案是可以!代码如下: main1中调用main2的主方法 package org.fiu.test; impor ...
- springmvc2 一个控制器写多个方法(非注解方式)
出处:http://blog.csdn.net/xuewenke/article/details/23895999 springmvc2 一个控制器写多个方法(非注解方式) 分类: spring 20 ...
- 一个Java复制目录的方法(递归)
/** * 将目标目录复制为指定目录(也可以用于复制文件) * @param src 源路径 * @param dest 目标路径 * @throws IOException */ public st ...
随机推荐
- 数据结构:后缀自动机 WJMZBMR讲稿的整理和注释
链接放在这里,有点难理解,至少我个人是的. 后缀自动机是一种有限状态自动机,其功能是识别字符串是否是母串的后缀.它能解决的问题当然不仅仅是判断是不是后缀这种事,跟字符串的连续子串有关的问题都可以往这个 ...
- gulp下静态资源的合并、压缩、MD5后缀
var gulp = require('gulp'); var RevAll = require('gulp-rev-all'); var uglify = require('gulp-uglify' ...
- Android ListView item项 显示动画
(1)使用LayoutAnimation 所谓的布局动画,其实就是为ViewGroup添加显示动画效果,主要用过LayoutAnimationController来控制实现.LayoutAnimati ...
- Android -- ImageView通过Bitmap得到网上的图片资源
1. 效果图
- mvc2 To 4
asp.net mvc2新特性:1.区域,有利于分模块开发 2.数据注解和验证 3.View层强类型辅助方法 4.UI Templates 5.httppost,默认参数asp.net mvc3新特性 ...
- error===>ld: 2 duplicate symbols for architecture x86_64
一,经历 1> 出现了以下错误,感觉像是GiftAnimationView文件的问题 /Users/liuzhu/Library/Developer/Xcode/DerivedData/test ...
- 关于Nodejs的多进程模块Cluster
关于Nodejs的多进程模块Cluster 前述 我们都知道nodejs最大的特点就是单进程.无阻塞运行,并且是异步事件驱动的.Nodejs的这些特性能够很好的解决一些问题,例如在服务器开发中,并 ...
- JSP自定义标签开发入门
一般情况下开发jsp自定义标签需要引用以下两个包 import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; 首先我们需要大致了解开发 ...
- 【MongoDB】2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:10061 由于目标计算机积极拒绝,无法连接。
1:启动MongoDB 2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errn ...
- wego微购RSS、Sitemap、Ping、腾讯拍拍网购采集插件
和哥们研究淘宝客,找到微购这个程序觉得挺不错的,但是地图和RSS功能不是特别完善,于是小憩一下,做了下初级的拓展,分享给大家,开源精神嘛,大家也可以去我的网站我要购物平台去看看. 1.拓展后台seoA ...