Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 225
user2029541 Avatar asked Oct 30 '22 01:10

user2029541


1 Answers

Try this:

NavigationPage.SetBackButtonTitle(this, string.Empty);
NavigationPage.SetHasBackButton(this, false);
like image 144
jzeferino Avatar answered Nov 15 '22 06:11

jzeferino