Nativescript behavior of the '< Go Back' button

前端 未结 2 1091
迷失自我
迷失自我 2021-01-24 01:14

I\'ve got the following ActionBar definition

2条回答
  •  一向
    一向 (楼主)
    2021-01-24 01:31

    UPDATE: Indeed, it appears that the NavigationButton in iOS can only be used to navigate back and can not be overridden with tap action. Reference from the NativeScript documentation

    In iOS, the back button is used explicitly for navigation. It navigates to the previous page and you cannot handle the tap event to override this behaviour.

    As for the appearing NavigationButton for iOS - it is by design just as in native iOS app. If you do not want to have back navigation you can force it with

    clearHistory: true
    

    Uncomment this line in the test application and delete the navigationButton from the sub-page and when navigation from main-page to sub-page the NavButton won't appear.

提交回复
热议问题