Преглед изворни кода

Grid封面背景加空判断

onecold пре 1 година
родитељ
комит
977ac6d444
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      entry/src/main/ets/view/LocalMusic.ets

+ 1 - 1
entry/src/main/ets/view/LocalMusic.ets

@@ -3808,7 +3808,7 @@ export struct LocalMusic {
         }
         .width(this.getGridWight())
         .borderRadius(12)
-        .backgroundImage(item.pixelMapPath)
+        .backgroundImage(StrUtil.isEmpty(item.pixelMapPath)?$r('app.media.avatar'):item.pixelMapPath)
         .backgroundImageSize({ height: '100%', width: '100%' })
         .backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
         .animation({ curve: Curve.Sharp, duration: 300 })