我有一个模式页面:
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/