Xamarin Forms - Hide navigation bar in MasterDetailPage

前端 未结 2 1873
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-20 13:32

I need hide navigation bar in xamarin forms 3.0.

I try this, but dont work: Hide Navigation Bar on MasterDetailPage

I want hide navigation b

相关标签:
2条回答
  • 2021-01-20 14:15

    In addition to Pedro's answer, you can also hide the navigation bar in your .xaml file. For example:

    <ContentPage NavigationPage.HasNavigationBar="False">
        ...
    </ContentPage>
    

    Note: This works in Xamarin 4.0 but I haven't tested it in 3.0.

    0 讨论(0)
  • 2021-01-20 14:22

    On the detail page you have to remove the navigation bar with NavigationPage.SetHasNavigationBar(this, false); in the constructor right after InitializeComponent()

    public partial class MyPage : NavigationPage
    {
        public MyPage()
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);
        }
    }
    
    0 讨论(0)
提交回复
热议问题