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

Donovan Bell (Britehouse) 1 Reputation point
2021-04-08T16:17:20.62+00:00

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?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JessieZhang-MSFT 7,706 Reputation points Microsoft Vendor
    2021-04-09T08:42:25.073+00:00

    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.

    2 people found this answer helpful.
    0 comments No comments

  2. Sándor Radócz 1 Reputation point
    2023-03-31T12:07:34.2066667+00:00

    I ran into an issue where I push a page to the stack, and wanted to hide the TabBar, so use this in that case

    Shell.TabBarIsVisible="False"