網站搜尋

typescript - 如何在 Nativescript 的底部導航中添加操作欄


我正在嘗試在底部導覽中添加操作抽屜或操作欄,有什麼方法嗎?我正在使用 TypeScript

我閱讀了 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

你最好的選擇是使用「前進導覽中的側向巢狀」模式。使用 Frame 作為根視圖,並為它設定一個主頁。在這個頁面內,添加你的操作欄和底部導覽本身。沒錯,底部導覽也可以巢狀在頁面內。

如需更多資訊,您可以查看文件:https://docs.nativescript.org/core-concepts/nested-navigation