HarmonyOS NavDestination的expandSafeArea问题
NavDestination默认的.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])设置之后没有避让顶部摄像头区域,如何设置可以避让顶部摄像头区域?UIAbility配置如下:
windowClass.setWindowLayoutFullScreen(true)
// 隐藏状态栏显示
windowClass.setWindowSystemBarEnable(['navigation'])
- 1.
- 2.
- 3.
代码如下:
build() {
NavDestination() {
Column() {
}
.width('100%')
.height('100%')
}
.title('工会新闻')
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.onReady((context: NavDestinationContext) => {
this.pathStack = context.pathStack
})
.onWillAppear(() => {
this.getArticleCategory()
})
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
HarmonyOS
赞
收藏 0
回答 1
相关问题
HarmonyOS NavDestination的menu问题
501浏览 • 1回复 待解决
HarmonyOS 使用NavDestination的foregroundColor问题
927浏览 • 1回复 待解决
HarmonyOS NavDestination中使用LocalStorage无效的问题
523浏览 • 1回复 待解决
HarmonyOS NavDestination生命周期问题
649浏览 • 1回复 待解决
HarmonyOS navdestination页面返回按钮问题
1664浏览 • 1回复 待解决
HarmonyOS 基于Navigation和NavDestination的跳转方式的弹窗问题
739浏览 • 1回复 待解决
HarmonyOS expandSafeArea不生效
1447浏览 • 1回复 待解决
HarmonyOS 怎样获取FrameNode含expandSafeArea的位置大小
553浏览 • 1回复 待解决
HarmonyOS NavDestination的title怎么居中
827浏览 • 1回复 待解决
HarmonyOS dialog形式的navdestination,跳转其他navdestination,需要支持默认左右转场
532浏览 • 1回复 待解决
HarmonyOS Navigation NavRouter NavDestination
783浏览 • 1回复 待解决
HarmonyOS 自定义CustomDialogController弹窗和NavDestination 跳转页面显示问题
1067浏览 • 1回复 待解决
HarmonyOS FlutterPage不支持设置expandSafeArea吗
741浏览 • 1回复 待解决
HarmonyOS TabContent中子组件使用expandSafeArea无效
1482浏览 • 1回复 待解决
HarmonyOS NavDestination组件加按钮
788浏览 • 1回复 待解决
HarmonyOS 给web组件设置expandSafeArea没有生效
1127浏览 • 1回复 待解决
HarmonyOS部分场景下expandSafeArea不生效
1950浏览 • 1回复 待解决
HarmonyOS NavDestination相关的生命周期回调
816浏览 • 1回复 待解决
HarmonyOS 使用navDestination报类型异常
507浏览 • 1回复 待解决
HarmonyOS NavDestination和page使用区别
818浏览 • 1回复 待解决
HarmonyOS Navigation 跳转的 NavDestination 又包含了 Navigation
678浏览 • 1回复 待解决
HarmonyOS navdestination左上角的返回键怎么去除?
1260浏览 • 1回复 待解决
Navigation和NavDestination的title能否居中显示?
1000浏览 • 1回复 待解决
1、windowClass.setWindowLayoutFullScreen(true)与 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 都是为了实现沉浸式,第一个是默认整个应用的沉浸式,第二个是通过拓展安全区域属性,参考API文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-develop-apply-immersive-effects-V5#section89942014473所以设置 expandSafeArea 并不会使全局沉浸式失效从而规避安全区。
2、expandSafeArea是单页面实现沉浸式,并且可以灵活设置指定组件扩展至安全区域,可以试下使用expandSafeArea按需设计沉浸式。