蜗牛爱课 - iOS7、8模态半透明弹出框
//源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;
}
通过上面的方法模态出的新页面的self.view设置有透明的时候,就可以看到上一层controller的页面。
版权声明:欢迎转载,请注明出处:蜗牛爱课 • 移动互联网
最新文章
- VS Extract Method
- 快速入门系列--MVC--04模型
- C语言:void指针
- Cordova - 使用Cordova开发iOS应用实战1(配置、开发第一个应用)
- Jquery简单瀑布流代码示例
- [Linux] yum和apt-get用法及区别
- VC++ 利用MAPI实现在程序中调用默认的电子邮件程序发送EMAIL(可以添加附件)。
- Kinect帮助文档翻译之一 入门
- UI基础 获取当前屏幕显示的viewcontroller
- css学习の第一弹—格式创建
- Perl基础速成
- javascript隐式原型
- LinkedList 实现 Queue
- PowerDesign的简单使用方法
- File available()方法
- win7 IIS7 发布网站遇到 HTTP 错误 500.19 由于权限不足
- 对WEB url 发送POST请求
- JQuery元素控制方法汇总
- ubuntu遇到的问题
- AngularJS - 路由 routing 基础示例