question

DonovanBellBritehouse-2127 avatar image
0 Votes"
DonovanBellBritehouse-2127 asked ·

How to hide Navigation Bar on Xamarin Forms when using Tab Navigation (Shell)

Hi,

I have created a Tabbed layout Xamarin project - which implements Xamarin.Forms.Shell framework for navigation.
I simply want to hide the Navigation Bar on the pages.

All the solutions I have read refer to either setting the following on the XAML page

NavigationPage.HasNavigationBar="False"

Or

NavigationPage.SetHasNavigationBar(this, false);

in the code behind.

None of these options seem to be working.

Is there something obvious I am missing to achieve this simple task?

dotnet-xamarinformsdotnet-xamarinforms-xamldotnet-mobile-general
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JessieZhang-2116 avatar image
0 Votes"
JessieZhang-2116 answered ·

Hello,


Welcome to our Microsoft Q&A platform!

If we wrap our page with a NavigationPage, we should be able to hide that navigation bar by setting a simple attribute in your page like so:

   <ContentPage NavigationPage.HasNavigationBar="false"
   ..... >
 </ContentPage>

Or add the following code within our page constructor:

   NavigationPage.SetHasNavigationBar(this, false);

But if you are using a Shell, code NavigationPage.HasNavigationBar="False" won't work.

You can try to add this line of code to each of your ContentPages

   Shell.NavBarIsVisible="False"


Best Regards,

Jessie Zhang


If the response is helpful, please click "Accept Answer" and upvote it.


Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.