更新时间: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: