如何把导航默认在最底下显示?

<?xml version="1.0" encoding="utf-8"?>
<DirectionalLayout
    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:height="match_parent"
    ohos:width="match_parent"
    ohos:orientation="vertical"
    ohos:background_element="#FFE0E3E3">

    <Text
        ohos:id="$+id:text_helloworld"
        ohos:height="match_content"
        ohos:width="match_content"
        ohos:layout_alignment="horizontal_center"
        ohos:text="$string:mainability_HelloWorld"
        ohos:text_size="40vp"

        />
    <DirectionalLayout
        xmlns:ohos="http://schemas.huawei.com/res/ohos"
        ohos:height="match_content"
        ohos:width="match_parent"
        ohos:orientation="horizontal"
        ohos:background_element="#FFFFFF"
        >
        <Button
            ohos:id="$+id:dynamic"
            ohos:height="match_content"
            ohos:width="match_parent"
            ohos:text="动态"
            ohos:text_size="10vp"
            ohos:element_top="$media:dt"
            ohos:weight="1"/>
        <Button
            ohos:id="$+id:friend"
            ohos:height="match_content"
            ohos:width="match_parent"
            ohos:text="好友"
            ohos:text_size="10vp"
            ohos:element_top="$media:hy"
            ohos:weight="1"/>
        <Button
            ohos:id="$+id:function"
            ohos:height="match_content"
            ohos:width="match_parent"
            ohos:text="功能"
            ohos:text_size="10vp"
            ohos:element_top="$media:gn"
            ohos:weight="1"/>
        <Button
            ohos:id="$+id:set"
            ohos:height="match_content"
            ohos:width="match_parent"
            ohos:text="我的"
            ohos:text_size="10vp"
            ohos:element_top="$media:yh"
            ohos:weight="1"/>
    </DirectionalLayout>
</DirectionalLayout>
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
鸿蒙
导航
显示
2022-07-20 15:26:24
40.2w浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
望海亦
3

DirectionalLayout默认从上往下,楼主可以参考DependentLayout

https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ui-java-layout-dependentlayout-0000001050729536

分享
微博
QQ
微信
回复
2022-07-20 17:00:29


相关问题
HarmonyOS List组件默认滚动到底部
922浏览 • 1回复 待解决
Tab导航栏tabbar子组件突出上沿显示
2881浏览 • 1回复 待解决