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 ...
 
随机推荐
- 盐水的故事[HDU1408]
			
盐水的故事Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submissio ...
 - BZOJ3564 : [SHOI2014]信号增幅仪
			
先把所有点绕原点逆时针旋转(360-a)度,再把所有点横坐标除以放大倍数p,最后用随机增量法求最小圆覆盖即可. 时间复杂度期望$O(n)$ #include<cstdio> #includ ...
 - Java集合框架学习总结
			
转自:http://www.cnblogs.com/oubo/archive/2012/01/07/2394639.html Oubo的博客 以下介绍经常使用的集合类,这里不介绍集合类的使用方法,只介 ...
 - [知识点]网络流之Dinic算法
			
// 此博文为迁移而来,写于2015年2月6日,不代表本人现在的观点与看法.原始地址:http://blog.sina.com.cn/s/blog_6022c4720102vrg4.html ...
 - 【JAVA】LOG4J使用心得
			
一.LOG4J基础: 1.日志定义 简单的Log4j使用只需要导入下面的包就可以了 // import log4j packages import org.apache.log4j.Lo ...
 - iOS 电话在后台运行时,我的启动图片被压缩
			
一,经历 <1> 第一感觉是启动图片没有设置好,长度设置小了.但是和网上说的正确方式相比,没什么差别. <2> 害怕是控制器影响的,又新建了一个项目,来检验启动图片是否设置成功 ...
 - Idea_Intellij Idea 12 生成serialVersionUID的方法
			
默认情况下Intellij IDEA是关闭了继承了java.io.Serializable的类生成serialVersionUID的警告.如果需要ide提示生成serialVersionUID,那么需 ...
 - html下拉菜单的实现
			
这是简单的下拉菜单 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w ...
 - About_MySQL Select--来自copy_03
			
MySQL Select 查询分类 单表查询:简单查询 多表查询:连接查询 联合查询:多个查询结果汇总 查询的组成 投影查询:挑选要显示的字段 select array1,array2,... f ...
 - Hive_进阶
			
回顾: hive 优点 1. 类sql语句靠近关系型数据库,可自定义函数,增加了扩展性,易于开发,减少mapreduce学习成本 2. hive转换sql语句为mapreduce程序以mapreduc ...