self presentViewController 弹出框透明化
来源:互联网 发布:淘宝客服几点下班 编辑:程序博客网 时间:2024/04/28 12:21
有时候应用需要使用覆盖全屏的弹出框,用presentViewController 处理起来会比较方便,但是在设置透明之后,presentViewController在动画中看到是透密的,动画结束后就变灰掉了不再透明。
在 AViewController present BViewController 时就需要把BViewController 设置为半透明,
BViewController = [[BViewController alloc] init];BViewController.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];[self presentViewController:BViewController animated:YES completion:nil];
然后在BViewController 的viewDidLoad 方法中设置
self.modalPresentationStyle = UIModalPresentationCustom;
就Okay啦~ 测试环境 iOS 8.2
另外 presentViewController 事件调用感觉有点延迟,点击present后,通常过几秒才执行,这是由于主线程没操作导致,添加唤起主线程的代码,
[self performSelectorOnMainThread:@selector(dontSleep) withObject:nil waitUntilDone:NO];-(void)dontSleep{ // do nothing.}
presentViewController 就会立即执行了。
0 0
- self presentViewController 弹出框透明化
- presentViewController 弹出半透明ViewController
- iOS presentViewController背景色透明
- iOS presentViewController 页面透明设置
- iOS presentViewController 之后设置界面透明
- 修改presentViewController弹出界面的大小
- presentViewController弹出界面的大小设置
- presentViewController弹出一个半透明的UIViewController
- presentViewController弹出有几种可以选择的类型
- presentViewController
- presentViewController
- presentViewController
- PresentViewController
- PresentViewController
- iOS 模态弹出 presentViewController弹出页面时有延迟
- android自定义dialog弹出框、透明背景
- 弹出框透明背景(超简单实现)
- iOS8下 presentViewController的透明部分 变成黑色不透明了
- 轮播图demo
- Lucene初接触
- 记录我的Spring学习过程,大神勿看
- BASIS--如何删除开发用户的开发Key
- adbkey与adbkey.pub
- self presentViewController 弹出框透明化
- 基于Struts2的文件上传
- 黑马程序员--Objective-C——第一个OC程序
- 关于SCO操作系统中配置crontab定时任务的一些经验
- ios证书制作与打包发布
- zookeeper使用和原理探究(一)
- ABAP开发如何动态的实现任意表的ALV显示
- 【数位DP】HDU 4389 X mod f(x)
- 【protobuf 001】 最常用的两种C++序列化方案的使用心得(protobuf和boost serialization)