王士厅

fix: 鸿蒙设备视频沉浸式视频色值与按钮接近的时候,整个顶部图标及tab按钮完全看不见

@@ -232,15 +232,15 @@ export struct VideoChannelPage { @@ -232,15 +232,15 @@ export struct VideoChannelPage {
232 .backgroundColor(Color.Transparent) 232 .backgroundColor(Color.Transparent)
233 233
234 } 234 }
235 - //顶部渐变遮罩  
236 - // .linearGradient({  
237 - // colors: [  
238 - // ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]  
239 - // ]  
240 - // })  
241 .zIndex(20) 235 .zIndex(20)
242 - .height($r('app.float.top_tab_bar_height_common'))  
243 - .margin({ 236 + .height(44 + px2vp(this.topSafeHeight))
  237 + //顶部渐变遮罩
  238 + .linearGradient({
  239 + direction: GradientDirection.Top, // 渐变方向
  240 + colors: this.currentTopNavSelectedIndex === 0 ? [['rgba(18, 18, 18, 0)', 0],
  241 + ['rgba(18, 18, 18, 0.5)', 1.0]] : []// 数组末尾元素占比小于1时满足重复着色效果
  242 + })
  243 + .padding({
244 top: px2vp(this.topSafeHeight) 244 top: px2vp(this.topSafeHeight)
245 }) 245 })
246 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 246 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)