Making a nav bar disappear in Xamarin.Forms

user1676682 picture user1676682 · Nov 1, 2014 · Viewed 11.6k times · Source

I'm completely new to Xamarin.Forms and C#, and I'm wondering how I can present a stack of Pages within a NavigationPage, without showing the navigation bar. Here's my code so far in App.cs:

    using Xamarin.Forms;

    namespace Test
    {
       public class App
         {
            public static Page GetMainPage ()
              {
                return new NavigationPage (new StartPage ());
              }
         }
    }

What can I do to make it so that when StartPage is presented, a navigation bar isn't visible on the screen?

Answer

Jason picture Jason · Nov 1, 2014

In StartPage, add this (in the constructor or ViewAppearing)

NavigationPage.SetHasNavigationBar(this, false);