Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a nav bar disappear in Xamarin.Forms

Tags:

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?

like image 611
user1676682 Avatar asked Nov 01 '14 18:11

user1676682


2 Answers

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

NavigationPage.SetHasNavigationBar(this, false); 
like image 159
Jason Avatar answered Sep 27 '22 21:09

Jason


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

NavigationPage.HasNavigationBar="False" 
like image 39
LCJ Avatar answered Sep 27 '22 21:09

LCJ