//源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. Hacker(四)----查看计算机的IP地址

    计算机接入Internet后,Internet就会给该计算机分配一个IP地址,若要查看该IP地址,可以借助度娘(百度,google)来实现.输入"IP地址查询"关键字,即可查看当前 ...

  2. Activity之间通过intent 传递Map

    //传递 Map<String,Object> data=orderlist.get(arg2-1); SerializableMap tmpmap=new SerializableMap ...

  3. Angular之filter学习

    过滤器(filter)正如其名,作用就是接收一个输入,通过某个规则进行处理,然后返回处理后的结果.主要用在数据的格式化上,例如获取一个数组中的子集,对数组中的元素进行排序等.ng内置了一些过滤器,它们 ...

  4. Repeater动态添加行

    <table class="table table-striped table-bordered table-hover">            <asp:Re ...

  5. WIFI网络访问(一)

    一,WIFI 网卡有哪些状态? WIFI 总共有以下五个状态,实际就是一些整形常量: 1.   WIFI_STATE_DISABLED : WIFI 不能使用,其值是: 1 . 2.   WIFI_S ...

  6. ThreadPoolExecutor(转)

    让ThreadPoolExecutor的workQueue占满时自动阻塞submit()方法 By learnhard | 2015 年 09 月 04 日 0 Comment 转载请注明出处:htt ...

  7. C++程序设计实践指导1.8求指定范围内的所有素数改写要求实现

    改写要求1:以指针为数据结构动态开辟存储空间 #include <cstdlib> #include <iostream> using namespace std; class ...

  8. Android TextView 字符串展示不同大小文字

    用Spannable字符串实现: String s= "Hello Everyone"; SpannableString ss1= new SpannableString(s); ...

  9. 使用firefoxprofile,selenium设置firefox,初始化firefox

    1.什么是firefoxprofile 简单的来说就是个人定制,比如你设置自己访问主页,禁用加载图片这些个性化的设置,都可以保存到一个文件夹下,就是firefoxprofile,下次使用时候,加载该f ...

  10. python操作 redis-list

    #!/usr/bin/python #!coding: utf-8 import redis if __name__=="__main__": try: conn=redis.St ...