如何使用xamarin.forms在导航栏上不显示图标?

问题描述 投票:-1回答: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>

我想为页面显示不同的内容,而不是其中一个选定选项卡的内容。通过这样做,导航栏可以在应用的每个页面上可见,并且每个页面的内容显示为不与标签内容链接。

编辑:在这张照片中,它显示了我的目标。底部导航栏但未选择任何选项卡,并且显示的内容与导航栏中的任何选项卡无关。 enter image description here但是在我的项目中,页面中显示的内容始终与导航栏中的一个选项卡相关.Content displayed is related to one of the bas in the nav bar

c# xamarin xamarin.forms bottombar
1个回答
1
投票

我在navigation-inside-a-tab样本上写了一个简单的演示基础。

  1. 我通过添加以下内容使tabbar成为底部: xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core" android:TabbedPage.IsSwipePagingEnabled="False" android:TabbedPage.ToolbarPlacement="Bottom"
  2. 我今天把页面变成了carousel-page
  3. 我还在todayPage中添加了导航行为。

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

结果如下:

result

© www.soinside.com 2019 - 2024. All rights reserved.