javascript - ionic 2 : "black screen" after modal close

标签 javascript ionic-framework ionic2

我有一个模式页面:

import {Page, ViewController, NavParams} from 'ionic-framework/ionic';
@Page({
  templateUrl: 'build/pages/tosmodal/tosmodal.html'
})
export class TOSModal {

    static get parameters() {
        return [[NavParams], [ViewController]];
    }

    constructor(navParams, viewCtrl) {
        this.data = navParams.data;
        this.viewCtrl = viewCtrl;
    }

    close() {
        this.viewCtrl.dismiss();
    }
}

当调用 close() 时,模式被关闭但上一页不出现。到 <ion-page>元素,添加了一个 display:none:

ion-page {
    display: none;
}

我错过了什么吗?也许在 onDismiss 方法中?

最佳答案

真的不明白为什么,但是当打开模式时,如果它出现在 setTimeout() 中,那么关闭会按预期工作:

setTimeout( () => {
    this.nav.present(modal);
})

关于javascript - ionic 2 : "black screen" after modal close,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35754197/

相关文章:

javascript - 绘制对象后,有没有办法在 Fabric js 中向该对象添加文本

javascript - 使用 Node.js 从 POST 请求中唯一标识用户

javascript - 我很好奇python是如何连接到网站的

ios - 在 Ionic for ios 中接收 URL

javascript - ng-repeat angularjs 中的输入标签

file - 将应用程序目录中的图像保存到手机图库时出现错误代码 5、ENCODING_ERR

Cordova 插件未使用 IONIC 框架定义

cordova - Ionic 2/3 中的圆角图像/个人资料图片

angular - 将组件放在 declarations 数组和 entryComponents 数组中

javascript - 无法读取 ionic 2 单元测试中未定义的属性 '_getPortal'