在iOS上present一个半透明的viewController
UIViewController *viewController = [[UIViewController alloc]init];
UIViewController* controller = self.view.window.rootViewController;
viewController.view.backgroundColor = [UIColor blackColor];
viewController.view.alpha = 0.5f;
controller.modalPresentationStyle = UIModalPresentationCurrentContext;
[controller presentViewController:viewController animated:NO completion:nil];
UIViewController 页面
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapGesture:)];
[self.view addGestureRecognizer:tapGesture];
- (void)tapGesture:(UITapGestureRecognizer *)gesture
{
[self dismissViewControllerAnimated:YES completion:nil];
}
在iOS上present一个半透明的viewController的更多相关文章
- present一个半透明的ViewController的方法
RecommandViewController *recommandVC = [[RecommandViewController alloc]init]; if([[[UIDevice current ...
- 在iOS上实现一个简单的日历控件
http://blog.csdn.net/jasonblog/article/details/21977481 近期需要写一个交互有点DT的日历控件,具体交互细节这里略过不表. 不过再怎么复杂的控件, ...
- presentModalViewController方法,present一个透明的viewController,带动画效果
//假设需要被present的控制器实例为controller,controller的背景色设置为clearColor UIViewController * rootcontroller = self ...
- Pluto - iOS 上一个高性能的排版渲染引擎
WeTest 导读 Pluto 是 iOS 上的一个排版渲染引擎,通过 JSON/JS 文件可以很方便地描述界面元素,开发效率很高,并且在流畅度,内存等方便有保证.pluto.oa.com 上有更多详 ...
- [开源]在iOS上实现Android风格的控件Toast
[开源]在iOS上实现Android风格的控件Toast iOS的风格和Apple其他产品一样,简单而粗暴.没有给人其他选择的余地,让你又爱又恨.同样的,Apple对待iOS平台的开发人员和对待大众消 ...
- iOS实现类似QQ的好友列表,自由展开折叠(在原来TableView的基础上添加一个字典,一个Button)
//直接代码 只包含 折叠展开字典的处理搭建#import "CFViewController.h" @interface CFViewController ()<UITab ...
- iOS 10 的一个重要更新-线程竞态检测工具 Thread Sanitizer
本文介绍了 Xcode 8 的新出的多线程调试工具 Thread Sanitizer,可以在 app 运行时发现线程竞态. 想想一下,你的 app 已经近乎大功告成:它经过精良的打磨,单元测试全覆盖. ...
- iOS上Delegate的悬垂指针问题
文章有点长,写的过程很有收获,但读的过程不一定有收获,慎入 [摘要] 悬垂指针(dangling pointer)引起的crash问题,是我们在iOS开发过程当中经常会遇到的.其中由delegat ...
- 【转】iOS 上常用的两个功能:点击屏幕和return退出隐藏键盘和解决虚拟键盘挡住UITextField的方法
iOS上面对键盘的处理很不人性化,所以这些功能都需要自己来实现, 首先是点击return和屏幕隐藏键盘 这个首先引用双子座的博客 http://my.oschina.net/plumsoft/blog ...
随机推荐
- tooltips弹出框制作
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- hdu 4640 Island and study-sister
bfs+状态压缩求出所有的状态,然后由于第一个节点需要特殊处理,可以右移一位剔除掉,也可以特判.然后采用集合的操作, #pragma comment(linker,"/STACK:10240 ...
- 【POJ2114】Boatherds 树分而治之
做广告: #include <stdio.h> int main() { puts("转载请注明出处[vmurder]谢谢"); puts("网址:blog. ...
- jquery获取当前元素坐标
1. jquery获取当前元素坐标 A) 获取对象
- 常用的50条linux 命令
从今天起,咱开始正式学习python了,于是遍整理了50条linux的常用命令. 1 线上查询帮助命令 :man 遇到什么不会的命令可以 man +你想要查询的命令 (需要有网),因为是英文的所以 ...
- Java中Thread类的start()和run()的区别
1.start()方法来启动线程,真正实现了多线程运行,这时无需等待run方法体代码执行完毕而直接继续执行下面的代码. 通 过调用Thread类的start()方法来启动一个线程,这时此线程是处于就绪 ...
- 黑马程序员——String类
------<a href="http://www.itheima.com" target="blank">Java培训.Android培训.iOS ...
- 黑马程序员——Java高级应用(一)
------<a href="http://www.itheima.com" target="blank">Java培训.Android培训.iOS ...
- easyui treeJson 带层数
public string GetTreeNav(int ID,int Num) { StringBuilder sb = new StringBuilder(); sb.Append("[ ...
- 影响MySQL性能的五大配置参数
我们今天主要和大家分享的是对MySQL性能影响关系紧密的五大配置参数,以下就是文章的具体内容描述,希望会给你带来一些帮助在此方面. 以下的文章主要是对MySQL性能影响关系紧密的五大配置参数的介绍,我 ...