IOS7、8模态半透明弹出框
2015-08-18 17:22
381 查看
[java] view
plaincopy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
//源Controller中跳转方法实现
,不支持旋转。
MKDialogController *controller = [[MKDialogController alloc] init];
controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
controller.providesPresentationContextTransitionStyle = YES;
controller.definesPresentationContext = YES;
controller.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[self presentViewController:controller animated:YES completion:nil];
} else {
self.view.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:controller animated:NO completion:nil];
self.view.window.rootViewController.modalPresentationStyle = UIModalPresentationFullScreen;
}
[java] view
plaincopy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
self.view.backgroundColor = [UIColor clearColor];
UIView *alphaView = [[UIView alloc] initWithFrame:self.view.frame];
UIView *baseView = [[UIView alloc] initWithFrame:self.view.frame];
alphaView.backgroundColor = [UIColor clearColor];
baseView.backgroundColor = [UIColor blackColor];
baseView.alpha = 0.7;
[self.view addSubview:baseView];
[self.view addSubview:alphaView];
版权声明:本文为博主原创文章,未经博主允许不得转载。 http://blog.csdn.net/liuhongwei123888/article/details/42001277/
plaincopy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
//源Controller中跳转方法实现
,不支持旋转。
MKDialogController *controller = [[MKDialogController alloc] init];
controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
controller.providesPresentationContextTransitionStyle = YES;
controller.definesPresentationContext = YES;
controller.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[self presentViewController:controller animated:YES completion:nil];
} else {
self.view.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:controller animated:NO completion:nil];
self.view.window.rootViewController.modalPresentationStyle = UIModalPresentationFullScreen;
}
[java] view
plaincopy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
self.view.backgroundColor = [UIColor clearColor];
UIView *alphaView = [[UIView alloc] initWithFrame:self.view.frame];
UIView *baseView = [[UIView alloc] initWithFrame:self.view.frame];
alphaView.backgroundColor = [UIColor clearColor];
baseView.backgroundColor = [UIColor blackColor];
baseView.alpha = 0.7;
[self.view addSubview:baseView];
[self.view addSubview:alphaView];
版权声明:本文为博主原创文章,未经博主允许不得转载。 http://blog.csdn.net/liuhongwei123888/article/details/42001277/
相关文章推荐
- iOS拨打电话的三种方法
- IOS学习之oc基础
- iOS ble通信
- IOS:身份证格式验证
- IOS学习之Foundation框架—集合
- iOS项目开发实战——自定义圆形进度提示控件
- IOS学习之Foundation框架—字符串
- IOS学习之Foundation框架—结构体
- IOS开发—截屏
- iOS 项目的目录结构能看出你的开发经验
- iOS详细解析视图控制器的正向和逆向传值
- iOS iOS8注册通知
- 静态扫描-Godeyes for ios
- iOS开发问题——简单的验证码倒计时显示
- iOS-如何集成iOS9里的3D Touch
- iOS-如何将非ARC的项目转换成ARC项目
- IOS 数组去重及排序
- iOS开发- Xcode插件- 规范注释生成器VVDocumenter 自己的见解
- iOS结构体二进制NSData相互转换
- iOS开发之Quartz2D生成PDF-Part2