【发布时间】:2019-10-08 11:33:35
【问题描述】:
当用户点击手机的返回按钮时会发生什么?模态打开时的情况。
注册了一个后退按钮:
// To prevent interference with ionic's own backbutton handling
// you can subscribe with a low priority instead
this.platform.backButton.subscribe(() => {
// code that is executed when the user pressed the back button
// and ionic doesn't already know what to do (close modals etc...)
self.modalController.dismiss();
});
代码的问题:
关闭/关闭模式没问题!
但它也将打开模式的页面推回。意味着它弹出模态页面后面的页面。
这不应该发生页面不应该弹出 - 只有模式应该关闭。
检查添加的图像 gif -> Click here to see the problem
【问题讨论】:
-
在代码末尾你可以尝试返回false;
-
不工作!同样的问题。
-
你找到解决办法了吗?
-
你找到解决办法了吗?
标签: ionic-framework ionic4 ionic-native