-1

我想在我的应用程序上有一个底部导航栏。但是当我使用标签页时,应用程序中显示的内容必须是导航栏上的标签之一。

<TabbedPage>

    <TabbedPage.Children>

        <!--<NavigationPage Title="test" IsVisible="False">
            <x:Arguments>
            <ContentPage>
                <Label Text="Not display this on nav bar but show its content page"/>
            </ContentPage>
            </x:Arguments>
        </NavigationPage>-->

        <NavigationPage Title="{x:Static Resource:AppResource.PaginaInicialTitulo}" Icon="homeBlack.png">
            <x:Arguments>
                <views2:ComoTeSentesPage/>
            </x:Arguments>
        </NavigationPage>

        <NavigationPage Title="{x:Static Resource:AppResource.CalendarioTitulo}" Icon="calendarBlack.png" BarBackgroundColor="White">
            <x:Arguments>
                <views:PaginaInicial/>
            </x:Arguments>
        </NavigationPage>

        <NavigationPage Title="{x:Static Resource:AppResource.ConviteTitulo}" Icon="phoneBlack.png">
            <x:Arguments>
                <views:PaginaInicial/>
            </x:Arguments>
        </NavigationPage>
    </TabbedPage.Children>
</TabbedPage>

我想为页面显示不同的内容,而不是所选选项卡之一的内容。通过这样做,导航栏可以在应用程序的每个页面上可见,并且每个页面的内容显示不会链接到选项卡内容。

编辑:在这张照片中,它显示了我的目标。底部有导航栏,但没有选择任何选项卡,并且显示的内容与导航栏中的任何选项卡都不相关。 在此处输入图像描述 但在我的项目中,页面中显示的内容总是与导航栏中的选项卡之一相关。显示的内容与导航栏中的 bas 之一相关

4

1 回答 1

1

我基于navigation-inside-a-tab示例编写了一个简单的演示。

  1. 我通过添加使标签栏底部:

    xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
    android:TabbedPage.IsSwipePagingEnabled="False"
    android:TabbedPage.ToolbarPlacement="Bottom"
    
  2. 我将 todayPage 更改为carousel-page

  3. 我还在 todayPage 中添加了导航行为。

我上传到Github,你可以下载:tabbedPage-Naviagtation-CarousePage

结果如下:

结果

于 2019-04-17T06:58:29.790 回答