简体   繁体   中英

Making a nav bar disappear in Xamarin.Forms

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?

在StartPage中,添加它(在构造函数或ViewAppearing中)

NavigationPage.SetHasNavigationBar(this, false);

XAML ,可以在ContentPage定义中按如下方式完成

NavigationPage.HasNavigationBar="False"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM