问题描述
color使用color: 'rgba(0, 0, 255, .5)'不生效
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width(200)
.height(200)
.borderRadius(20)
.margin({ top: 40, bottom: 30 })
.shadow({ radius: 10, color: 'rgba(0, 0, 255, .5)', offsetY: 12 })
问题原因:系统规格,0.5不能省略0,需要写完整。
解决措施:
方式1.可以采用color: '\#0000FF80'的方式配置透明度。
方式2.color: 'rgba(0, 0, 255, 0.5)'。