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 })
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.


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


相关问题
HarmonyOS color文件不支持rgba
467浏览 • 1回复 待解决
HarmonyOS color.json
624浏览 • 1回复 待解决
HarmonyOS bindPopup设置color无效
1449浏览 • 0回复 待解决
HarmonyOS Color转ColorFilter方式?
583浏览 • 1回复 待解决
HarmonyOS color argb工具类问题
783浏览 • 1回复 待解决
动态修改style="background-color发现错误
3484浏览 • 1回复 待解决
求助:devecostudio中的xml没有color preview
6668浏览 • 2回复 待解决
鸿蒙int类型转为Color类型怎么转?
9534浏览 • 4回复 已解决
HarmonyOS H5页面使用alert函数生效
403浏览 • 1回复 待解决
HarmonyOS color颜色怎么指定透明度?
1345浏览 • 1回复 待解决
提问
该提问已有2人参与 ,帮助了59人