我想在我的应用上有一个底部导航栏。但是当我使用选项卡式页面时,应用程序中显示的内容必须是导航栏上的选项卡之一。
<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>
我想为页面显示不同的内容,而不是其中一个选定选项卡的内容。通过这样做,导航栏可以在应用的每个页面上可见,并且每个页面的内容显示为不与标签内容链接。
编辑:在这张照片中,它显示了我的目标。底部导航栏但未选择任何选项卡,并且显示的内容与导航栏中的任何选项卡无关。 但是在我的项目中,页面中显示的内容始终与导航栏中的一个选项卡相关.
我在navigation-inside-a-tab
样本上写了一个简单的演示基础。
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
android:TabbedPage.IsSwipePagingEnabled="False"
android:TabbedPage.ToolbarPlacement="Bottom"
我上传到Github你可以下载:tabbedPage-Naviagtation-CarousePage
结果如下: