简体   繁体   中英

Xamarin Forms masterdetail hide backbutton

I am working on Xamarin forms shared project with a master detail page. When I run the app the master detail page is the first item that loads yet it shows the back button which once clicked opens the navigation (master) drawer. This makes no navigation sense whatsoever! I have tried to hide the back button but have not been able to do this. Has anyone come across this and succeeded in doing this? I would prefer a programmatical solution rather than a xaml one.

I have tried adding the below code:

NavigationPage.SetHasBackButton(this, false);

But this doesn't work. I want to keep the toolbar as I will be adding my own menu items here but want the back button gone.

Try this:

NavigationPage.SetBackButtonTitle(this, string.Empty);
NavigationPage.SetHasBackButton(this, false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM