【发布时间】:2020-04-18 18:08:14
【问题描述】:
我遇到了如何禁用后退按钮硬件的问题。我只希望它在我的应用程序的主页上工作,而不是在其他页面上工作。当您在主页上时它运行良好,但也适用于打开的所有其他页面。我希望用户能够在除主页之外的所有页面上使用后退按钮。 这是我的代码
`deactivateBackButton()
this.subscribe = this.platform.backButton.subscribeWithPriority(666666,()=>{
if (this.constructor.name == "HomePage") {
if (window.confirm("Do you want to exit app")) {
navigator["app"].exitApp();
}
}
});
}`
【问题讨论】:
标签: android angular ionic-framework