//源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的页面。


版权声明:欢迎转载,请注明出处:蜗牛爱课 • 移动互联网

蜗牛爱课 - iOS7、8模态半透明弹出框的更多相关文章

  1. div 模拟alert弹出框

    --------------信息展示弹出框---------------- <style> .over{background-color: rgba(0, 0, 0, 0.7);displ ...

  2. 蜗牛爱课 -- iOS 设计模式之模板模式

    1 前言 模板方法模式是面向对象软件设计中一种非常简单的设计模式.其基本思想是在抽象类的一个方法定义“标准”算法.在这个方法中调用的基本操作由子类重载予以实现.这个方法成为“模板”.因为方法定义的算法 ...

  3. 蜗牛爱课- iOS中plist的创建,数据写入与读取

    iOS中plist的创建,数据写入与读取功能创建一个test.plist文件-(void)triggerStorage{    NSArray *paths=NSSearchPathForDirect ...

  4. 蜗牛爱课- CGAffineTransformMakeRotation 实现一张图片的自动旋转

    self.locationTimer =[NSTimer scheduledTimerWithTimeInterval: 0.01 target: self selector:@selector(tr ...

  5. 蜗牛爱课- iOS中定时器NSTimer使用

    调用一次计时器方法: //不重复,只调用一次.timer运行一次就会自动停止运行 self.locationTimer = [NSTimer  target:self selector: @selec ...

  6. html、css和js原生写一个模态弹出框,顺便解决父元素半透明子元素不透明效果

    模态框: html部分: <!-- 按钮 --> <button id="box" onclick="pop_box()">弹出框< ...

  7. UIPresentationController - iOS自定义模态弹出框

    参考: https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/Definin ...

  8. 控制非模态弹出框(showModelessDialog)唯一且随父页面关闭

    网站开发中,常常会遇到需要弹出窗体的情况,一般弹出框有模态和非模态两种,如下: 模态:window.showModalDialog() 非模态:window.showModelessDialog() ...

  9. Bootstrap模态弹出框

    前面的话 在 Bootstrap 框架中把模态弹出框统一称为 Modal.这种弹出框效果在大多数 Web 网站的交互中都可见.比如点击一个按钮弹出一个框,弹出的框可能是一段文件描述,也可能带有按钮操作 ...

随机推荐

  1. linux下php扩展curl的安装

    方法一 安装cURL wget http://curl.haxx.se/download/curl-7.17.1.tar.gz tar -zxf curl-7.17.1.tar.gz ./config ...

  2. Android默认启动程序问题

    参考地址:http://www.cnblogs.com/Lewis/p/3316946.html 怎么让我们自己开发的Android程序设为默认启动呢?其实很简单,只要在AndroidManifest ...

  3. java中List的用法

    list的添加删除等操作 import java.util.*; class TestList { public static void main(String[] args) { List<S ...

  4. 《JavaScript 闯关记》之语法

    JavaScript 的语法大量借鉴了 C 及其他类 C 语言(如 Java 和 Perl)的语法.因此,熟悉这些语言的开发人员在接受 JavaScript 更加宽松的语法时,一定会有种轻松自在的感觉 ...

  5. OSError: [Errno 13] Permission denied: '/etc/cron.d/1sandbox_registration'

    使用Hortonworks 的twitter tutorial: http://hortonworks.com/hadoop-tutorial/how-to-refine-and-visualize- ...

  6. Asp.Net使用Bulk批量插入数据

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Di ...

  7. C++中把string转成char

    c_str函数的返回值是const char*的,不能直接赋值给char*, c++语言提供了两种字符串实现,其中较原始的一种只是字符串的c语言实现. 与C语言的其他部分一样,它在c+的所有实现中可用 ...

  8. eclipse项目提交到git

    http://www.open-open.com/lib/view/open1406105786710.html 1.在https://github.com   new repository 2.在e ...

  9. Windows下Vundle安装

    鼠标手老是发作,没办法.想学习vim尽量减少编码时使用鼠标的频率.安装好gVim开始安装Vundle插件,总结下安装过程和各种遇到的坑: github上VundleVim倒是有说明 Windows S ...

  10. python解析xml

    python解析xml import xml.dom.minidom as minidom dom = minidom.parse("aa.xml") root = dom.get ...