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 ...
随机推荐
- [转]使用EasyRsa3为OpenVPN生成密码
1. 下载Easy RSA3 下载完并解压后,拷贝一份到/etc/openvpn和/home/client下 #.3版本需要独立下载个easy-rsa,该包用来制作ca证书,服务端证书,客户端证书 w ...
- BZOJ 1054 题解
1054: [HAOI2008]移动玩具 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 1888 Solved: 1035[Submit][Stat ...
- 【POJ】3243 Clever Y
http://poj.org/problem?id=3243 题意:求$a^y \equiv b \pmod{p}$最小的$y$.(0<=x, y, p<=10^9) #include & ...
- JS中的专业术语
本身虽然是学技术出身,但.....此处省略N个字符 1.Namespace 命名空间 允许开发人员在一个独特, 应用相关的名字的名称下捆绑所有功能的容器. 2.Class类 定义对象的特征.它是对象的 ...
- HDU 2825 Wireless Password(AC自动机+DP)
题目链接 做题, #include <cstdio> #include <string> #include <cstring> using namespace st ...
- BZOJ1171: 大sz的游戏&BZOJ2892: 强袭作战
Description 大sz最近在玩一个由星球大战改编的游戏.话说绝地武士当前共控制了N个星球.但是,西斯正在暗处悄悄地准备他们的复仇计划.绝地评议会也感觉到了这件事.于是,准备加派绝地武士到各星球 ...
- BZOJ1565: [NOI2009]植物大战僵尸
Description Input Output 仅包含一个整数,表示可以获得的最大能源收入.注意,你也可以选择不进行任何攻击,这样能源收入为0. Sample Input 3 2 10 0 20 0 ...
- C#文字样式
[字体] 中文名称 英文名称宋体 SimSun黑体 SimHei微软雅黑 Microsoft YaHei微软正黑体 Microsoft JhengHei新宋体 NSimSun新细明体 PMin ...
- Sortable Observable Collection in C#
Sorting outside the collection protected override void OnNavigatedTo(NavigationEventArgs e) { if (Se ...
- Hibernate前置和后置方法
public class Test01 { private ServiceRegistry sr =null; private Session se =null; private Transactio ...