且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

$ ionicModal打开后硬件后退按钮不起作用?

更新时间:2023-08-23 09:08:10

首先检查正在打开的离子模态实例是否被正确删除。如果您打开两次相同的模态实例但只关闭一次,则可能会出现后退按钮问题。因此,模态的一个实例可能尚未清理。

First check whether ionic modal instances which are opening are properly getting removed are not. Back button issue may occur if you are opening same modal instance twice but closing only once. So one instance of modal may not yet cleaned up.

在这种情况下,硬件后退按钮将尝试关闭每次尚未清理的模态,而不是转到上一个视图。由于'Dismiss modal'的优先级(200)高于'返回上一个视图'(100)。

In this case Hardware back button will try to Dismiss modal which is not yet cleaned up for each time rather than going to previous view. Since 'Dismiss modal' has higher priority(200) than 'Return to previous view'(100).

registerBackButtonAction的优先级如下:

The priorities for the registerBackButtonAction are as follows:


  • 返回上一个视图= 100

  • 关闭侧菜单= 150

  • 解雇模式= 200

  • 关闭操作表= 300

  • 关闭popup = 400

  • 关闭加载重叠= 500

  • Return to previous view = 100
  • Close side menu = 150
  • Dismiss modal = 200
  • Close action sheet = 300
  • Dismiss popup = 400
  • Dismiss loading overlay = 500

了解更多关于$ ionicModal的信息

了解更多关于$ ionicPlatform.registerBackButtonAction 的信息