Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
NavigationPage.SetHasNavigationBar false doesn't work inside MasterDetailPage #1437
Migrated from https://bugzilla.xamarin.com/show_bug.cgi?id=51509
Steps to Reproduce
NavigatonBar shouldn't be visible.
NavigatonBar is visible.
@ikerhg can you upload a test case i used this one here https://github.com/jkastner/XamFormsBugSample_51509 and this works fine
Hi @rmarinho ,
We are trying to use a custom bar and open menu (so we need popover) when clicking a custom button in our bar. So we need to hide default from the start. This custom bar is only a stacklayout located in the top of the page with a button.
If we set Title to empty string and navigation bar to false in "BrowseEntriesPage.xaml" we still continue seeing the menu bar:
Is there any way to hide the navigation bar always and show popover menu when clicking a button.
Thank you very much.
I've tested this. You can check with your own project:
Change BrowseEntriesPage xaml from this:
When you launch the project you'll see how the top bar appears with empty title.
But if you downgrade Xamarin.Forms to the last working version before the bug appeared (18.104.22.168), with the same code (you'll only need to remove or change a couple of BackgroundColor properties) the top bar won't appear (as expected since we are setting it that way).
Do you need me to upload your project with doengraded Xamarin version and those changes in BrowseEntriesPage?
Hi again @rmarinho,
Here you have the downgraded (working) version. Check how the bar does not appear on first page with this Xamarin Forms version.
I haven't added any custom bar or means to show menu, it is not necessary dor the bug reproduction proposal.
Just a reminder of more background where this came from: https://bugzilla.xamarin.com/show_bug.cgi?id=51509. It is an issue in UWP where the bar does not hide but it should be hidden. It seems to hide properly after toggling the master view on/off.
referenced this issue
Jan 21, 2018
referenced this issue
Mar 14, 2018
Behavior has changed but...anyone else still not seeing it all work right? My MasterDetailPage.MasterBehavior is set to
This is not working for me in the latest XF 22.214.171.1247583 . @rmarinho can you reopen pls?
let w = MainWindowV() let np = NavigationPage(w) do NavigationPage.SetHasNavigationBar(np, false) do base.MainPage <- MasterDetailPage(Master = ContentPage(Title = "Master"), Detail = np, MasterBehavior = MasterBehavior.Popover)
Also, it's odd that to remove the bar we need to wrap a ContentPage in a NavigationPage. Better to have a property on MasterDetailPage instead.