AppViewBackButtonVisibility not working

白昼怎懂夜的黑 提交于 2019-12-12 04:48:32

问题


I'm trying to show a "back" button on my (Xamarin.Forms) UWP app when running on a desktop PC. I'm running the following code in the App's OnLaunched method:

SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;

But the back button is not shown.

The line does work on a pure UWP app. But not in Xamarin.Forms.

Is there any additional step needed to get this working?

EDIT

It seems now that when navigating to a new NavigationPage(page) instead of just the page - that's what creates this problem. Am checking it now.


回答1:


You need to use

MainPage=new NavigationPage(new rootPage).

Then use Navigation.PushAsync and PopAsync to get that Back button shown and hidden automatically



来源:https://stackoverflow.com/questions/44661275/appviewbackbuttonvisibility-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!