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

问题描述 投票:1回答:1

我试图添加一个动作抽屉或动作栏的底部导航,任何想法如何?

我读了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>

typescript nativescript
1个回答
0
投票

你最好的选择是使用 "Nesting Lateral in Forward Navigation "模式,使用一个Frame作为根视图,并为它准备一个主页面。在这个页面里面,添加你的操作栏和BottomNavigation本身。没错,BottomNavigation也可以嵌套在页面里面。

更多信息,你可以看看文档。https:/docs.nativescript.orgcore-conceptsnested-navigation)。

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