From 3813c9fe0ee0407a10d2ecec8be1e4c89e5e0c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Thu, 17 Oct 2024 18:39:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ets/view/SafeView.ets | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/ets/view/SafeView.ets b/src/main/ets/view/SafeView.ets index 76133d9..0fdbceb 100644 --- a/src/main/ets/view/SafeView.ets +++ b/src/main/ets/view/SafeView.ets @@ -12,13 +12,15 @@ export interface TitleBarBtn { @Component export struct SafeView { @Consume('pageInfos') pageInfos?: NavPathStack - @Link isLoading: boolean + @Prop isLoading: boolean // 是不是沉浸式 @Prop isImmersive: boolean // 设置导航栏标题 @Prop titleText: ResourceStr // 设置导航栏背景色 - @Prop backgroundColorY: ResourceColor + @Prop backgroundColorNav: ResourceColor + // 设置导航栏背景色 + @Prop backgroundColorView: ResourceColor // 设置导航栏背景不透明度 // 元素的不透明度,取值范围为0到1,1表示不透明,0表示完全透明, 达到隐藏组件效果,但是在布局中占位。 @Prop opacitys: number | Resource @@ -60,7 +62,7 @@ export struct SafeView { Row() .height(WindowHelper.topRectHeight) .width('100%') - .backgroundColor(this.backgroundColorY ?? 'white') + .backgroundColor(this.backgroundColorNav ?? '#ffffff') .opacity(undefined === this.opacitys ? 1 : this.opacitys > 1 ? 1 : this.opacitys < 0 ? 0 : this.opacitys) Row() { @@ -169,7 +171,7 @@ export struct SafeView { }.width(110) .justifyContent(FlexAlign.End) } - .backgroundColor(this.backgroundColorY ?? 'white') + .backgroundColor(this.backgroundColorNav ?? '#ffffff') .opacity(undefined === this.opacitys ? 1 : this.opacitys > 1 ? 1 : this.opacitys < 0 ? 0 : this.opacitys) .justifyContent(FlexAlign.SpaceBetween) .height(44) @@ -206,7 +208,7 @@ export struct SafeView { .hideTitleBar(true) .width('100%') .height('100%') - .backgroundColor('white') + .backgroundColor(this.backgroundColorView??'#ffffff') .onBackPressed(() => { if (this.onBackEvent) { this.onBackEvent()