HarmonyOS 设置全屏后,NavDestination页面底部导航栏还是会留出来

HarmonyOS
2024-12-26 15:07:38
670浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
zbw_apple

参考以下代码,支持文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-develop-apply-immersive-effects-V5#section15671730447

底部默认留出的是安全区域。

// xxx.ets
@Entry
@Component
struct VideoCreateComponent {
  build() {
    Column() {
      Row() {
        Text('Top Row').fontSize(40).textAlign(TextAlign.Center).width('100%')
      }
      .backgroundColor('#F08080')
      // 设置顶部绘制延伸到状态栏
      .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
      Row() {
        Text('ROW2').fontSize(40)
      }.backgroundColor(Color.Orange).padding(20)
      Row() {
        Text('ROW3').fontSize(40)
      }.backgroundColor(Color.Orange).padding(20)
      Row() {
        Text('ROW4').fontSize(40)
      }.backgroundColor(Color.Orange).padding(20)
      Row() {
        Text('ROW5').fontSize(40)
      }.backgroundColor(Color.Orange).padding(20)
      Row() {
        Text('Bottom Row').fontSize(40).textAlign(TextAlign.Center).width('100%')
      }
      .backgroundColor(Color.Orange)
      .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
    }
    .width('100%').height('100%').alignItems(HorizontalAlign.Center)
    .justifyContent(FlexAlign.SpaceBetween)
    .backgroundColor(Color.Green)

  }
}
  • 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.
分享
微博
QQ
微信
回复
2024-12-26 16:55:48


相关问题
HarmonyOS 怎么去掉底部导航
1053浏览 • 1回复 待解决
HarmonyOS 获取手机底部导航高度
1107浏览 • 1回复 待解决
HarmonyOS 如何获取底部导航高度?
975浏览 • 1回复 待解决
HarmonyOS 如何让内容超出底部导航
639浏览 • 1回复 待解决
HarmonyOS 导航跳转重置栈
923浏览 • 1回复 待解决
#鸿蒙通关秘籍#如何设置底部导航
850浏览 • 1回复 待解决
HarmonyOS 怎么设置导航全局样式
744浏览 • 1回复 待解决
HarmonyOS 如何动态设置导航title标题
628浏览 • 1回复 待解决
如何设置状态导航的颜色
4501浏览 • 1回复 待解决