0
votes

I am new at Xamarin.Forms, I came from android. I found on Xamarin.Forms Docs that is not recommended to put a TabbedPage in a NavigationPage so what should I do to navigate to another page. And I don't want to navigate from one of the tabbedPage children, but to navigate from the tabbed page to a whole new page ?

1
Does it work now ?Lucas Zhang
Hi Lucas, according to your suggested answer, when I navigate from page 1 or page 2. the tab bar will remain at the bottom and the new page will render only in the part of the screen above the bar. I want to navigate entirely from the tabbed page. like for example on Facebook when you go to write a new post, you go to a new page and the tab bar doesn't appear.Yamen Emad

1 Answers

0
votes

not recommended to put a TabbedPage in a NavigationPage

That means we would better set the MainPage of the App as a TabbedPage directly like

public App()
{
    InitializeComponent();

    MainPage = new TabbedPage(); // it's better than MainPage = new NavigationPage(new TabbedPage());
}

In Tabbed Pagged we could set the child page of it as NavigationPage like following

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:local="clr-namespace:xxx;assembly=xxx"
            x:Class="TabbedPageWithNavigationPage.MainPage">
    <NavigationPage Title="Page1" IconImageSource="xxx.png">
        <x:Arguments>
            <local:SchedulePage />
        </x:Arguments>
    </NavigationPage>
    <NavigationPage Title="Page2" IconImageSource="xxx.png">
        <x:Arguments>
            <local:SchedulePage />
        </x:Arguments>
    </NavigationPage>
</TabbedPage>

And in Page1 or Page2 we could navigate to another ContentPage

await Navigation.PushAsync (new xxxPage ());