//源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. 【组合数学:第一类斯特林数】【HDU3625】Examining the Rooms

    Examining the Rooms Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  3. Extjs 6 MVC开发模式(二)

    1.Extjs MVC开发模式 在JS的开发过程中,大规模的JS脚本难以组织和维护,这一直是困扰前端开发人员的头等问题.Extjs为了解决这种问题,在Extjs4.x版本中引入了MVC开发模式,开始将 ...

  4. PL/SQL分页查询

    create or replace procedure fenye(tabelname in varchar2,currentpage in number,pageSize in number,inW ...

  5. asp.net httpmodule问题

    以前学过IHttpModule实现,这次用到了(.net2013),注册完成后出现如下错误: An ASP.NET setting has been detected that does not ap ...

  6. (原)JNI中env->GetByteArrayElements和AndroidBitmap_getInfo的冲突

    也不是很确定,前段时间的代码没有出问题,但是今天调试了半天,一直崩溃:vm aborting. 以前的部分代码: JNIEXPORT void JNICALL XXX (JNIEnv* env,job ...

  7. Sicily 1790. Single Round Match

    高进度求余 或者 将一个数奇位上的数字与偶位上的数字分别加起来,再求它们的差,如果这个差是11的倍数(包括0),那么,原来这个数就一定能被11整除. #include <iostream> ...

  8. 【Heritrix基础教程之4】开始一个爬虫抓取的全流程代码分析

    在创建一个job后,就要开始job的运行,运行的全流程如下: 1.在界面上启动job 2.index.jsp 查看上述页面对应的源代码 <a href='"+request.getCo ...

  9. MyBatis 注解

    注解 目标 相对应的 XML 描述 @CacheNamespace 类 <cache> 为给定的命名空间 (比如类) 配置缓存. 属性:implemetation,eviction, fl ...

  10. C# Winform程序本地化应用

    1. 创建一个WinForm应用程序 – “WindowsFormsLocalizationTest”. 2. 在主窗体属性栏里,把Localizable属性设置成”True”. 3. 添加两个But ...