Xamarin Forms - Show Cancel button in toolbar items instead of Back (iOS)

后端 未结 2 1905
失恋的感觉
失恋的感觉 2020-12-21 04:35

I want to change the standard Back button in the NavigationBar on iOS to a Cancel button like the \"New contact\" screen in iOS.
I

2条回答
  •  盖世英雄少女心
    2020-12-21 04:55

    Do the following in the constructor of the page doing the navigation push. This will work for all pages pushed on to the stack.

    NavigationPage.SetBackButtonTitle(this, "Cancel");
    

    Where this is the ContentPage (or any type of page) of course

提交回复
热议问题