Moni Bhattacharya
Moni Bhattacharya

Reputation: 133

Using Tabbed Page with Master Detail page in Xamarin Forms

I am using MasterDetail page in xamarin forms, my detail page is a tabbed page with three tabs, my problem is when I am writing below code in MasterDetail Page to remove NavigationBar from that page

        protected async override void OnAppearing ()
        {
            base.OnAppearing ();
            NavigationPage.SetHasNavigationBar (this,false);

        }

Then my tab page is not working properly like all tabs got disabled. But without using this code everything is working fine. But I need to write this code as I don't want that navigation bar on my master detail page.

Upvotes: 0

Views: 2698

Answers (1)

Mario Galván
Mario Galván

Reputation: 4032

You can hide the navigation bar by creating a new NavigationPage(new YourTabbedPage) and then you can use the code to hide the NavigationBar

NavigationPage.SetHasNavigationBar (this,false);

You can have different NavigationPage MainPage of your App.cs you can have an instance of your App.cs like this:

public static App Instance { get; private set; }

So now you can set:

App.Instance.MainPage = new NavigationPage(new YoutTabbedPage());  

Hope this helps.

Upvotes: 0

Related Questions