c# – Making a nav bar disappear in Xamarin.Forms-ThrowExceptions

Exception or error:

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?

How to solve:

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

NavigationPage.SetHasNavigationBar(this, false);


In XAML it can be done as follows, inside ContentPage definition


Leave a Reply

Your email address will not be published. Required fields are marked *