如何在Nativescript的底部导航中添加操作栏

时间:2020-06-16 20:48:32

标签: typescript 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>

1 个答案:

答案 0 :(得分:0)

您最好的选择是使用“正向嵌套嵌套”模式。 将框架用作根视图,并为其提供主页。在此页面内,添加操作栏和BottomNavigation本身。没错,BottomNavigation也可以嵌套在页面内。

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