美文网首页
鸿蒙app设置组件背景色backgroundColor支持的赋值

鸿蒙app设置组件背景色backgroundColor支持的赋值

作者: iOS开发小学生 | 来源:发表于2024-10-22 15:32 被阅读0次

backgroundColor 支持的赋值方式

1.使用鸿蒙Color API属性方式
.backgroundColor(Color.Red)
2.使用十六进制方式
.backgroundColor(0xF5DEB3)
3.使用十六进制方式
.backgroundColor('#F5DEB3')
4.使用RGB颜色方式
.backgroundColor('rgb(85,123,205)')
5.引用资源方式
.backgroundColor($r('app.color.health_bg_color'))
{
  "color": [
    {
      "name": "start_window_background",
      "value": "#FFFFFF"
    },
    {
      "name": "health_bg_color",
      "value": "#9AE2A6"
    }
  ]
}

相关文章

网友评论

      本文标题:鸿蒙app设置组件背景色backgroundColor支持的赋值

      本文链接:https://www.haomeiwen.com/subject/ntsrdjtx.html