我有一个 QML 控件来显示 .svg 图片。我希望 .svg 的颜色适合我的用户定义主题。但我不知道如何改变 svg 的颜色。
我有一个像这样的
Image control
,但我没有color property
。我该怎么办?
Image {
id: icon
anchors{
top: parent.top
bottom: parent.bottom
right: parent.right
}
width: height
source: "../Image/BxChevronDown.svg"
}
我已经得到答案:应该使用 ColorImage
ColorImage {
id: icon
anchors{
top: parent.top
bottom: parent.bottom
right: parent.right
}
width: height
source: "../Image/BxChevronDown.svg"
color: theme.themeColor0
}