color使用color: 'rgba(0, 0, 255, .5)'不生效

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 })


HarmonyOS
2024-01-30 21:27:03
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
WilliamGates

系统规格,0.5不能省略0,需要写完整。

方式1.可以采用color: '#0000FF80'的方式配置透明度。

方式2.color: 'rgba(0, 0, 255, 0.5)'。

分享
微博
QQ
微信
回复
2024-02-01 10:06:32
相关问题
使用position之后height生效
289浏览 • 1回复 待解决
动态修改style="background-color发现错误
831浏览 • 1回复 待解决
鸿蒙int类型转为Color类型怎么转?
6694浏览 • 4回复 已解决
求助:devecostudio中的xml没有color preview
4191浏览 • 2回复 待解决
Color.Black如何转成对应的颜色编码
236浏览 • 1回复 待解决
ConstraintSize尺寸设置生效
364浏览 • 1回复 待解决
textfield的截断属性生效
887浏览 • 1回复 待解决
通过WindowProperties设置属性生效
264浏览 • 1回复 待解决
Web组件的onKeyEvent键盘事件生效
307浏览 • 1回复 待解决
List组件的initialIndex属性设置生效
230浏览 • 1回复 待解决
用数组变量控制组件属性生效
233浏览 • 1回复 待解决
提问
该提问已有0人参与 ,帮助了0人