Ver Fonte

环境切换

徐勤民 há 6 meses atrás
pai
commit
3813c9fe0e
1 ficheiros alterados com 7 adições e 5 exclusões
  1. 7 5
      src/main/ets/view/SafeView.ets

+ 7 - 5
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()