首页 > 解决方案 > 如何在 Nativescript 的底部导航中添加操作栏

问题描述

我正在尝试将操作抽屉或操作栏添加到底部导航,有什​​么想法吗?我使用打字稿

我阅读了 nativescript 文档,似乎没有找到任何关于它的信息。

请帮忙

这是我的代码如下:

   <BottomNavigation selectedIndex="0">


<TabStrip>
    <TabStripItem>
        <Label text="Home"></Label>
        <Image src="font://&#xf015;" class="fas t-36"></Image>
    </TabStripItem>

    <TabStripItem class="special">
        <Label text="Profile"></Label>
        <Image src="font://&#xf007;" class="fas t-36"></Image>
    </TabStripItem>
</TabStrip>


<TabContentItem>

        <StackLayout>

        <VideoPlayer:Video id="nativeVideoPlayer"
        controls="true" loop="true" autoplay="true" Height="1000" scaleY="1.2"
        src="~/Videos/v2.mp4" />



    </StackLayout>

</TabContentItem>

<TabContentItem class="pp">



  <StackLayout>

    <Image src="font://&#xf2bd;" class="fasl t-36l"></Image>
     <Label text="Sign up for an account" class="align1"/>
    <Button text="Sign up" tap="navigateToFeatured" class="signupcolor"/>

  </StackLayout>




</TabContentItem>

标签: typescriptnativescript

解决方案


您最好的选择是使用“在向前导航中横向嵌套”模式。使用 Frame 作为根视图,并为其设置一个主页。在此页面内,添加您的操作栏和 BottomNavigation 本身。没错,BottomNavigation 也可以嵌套在页面内。

有关更多信息,您可以查看文档:https ://docs.nativescript.org/core-concepts/nested-navigation


推荐阅读