原图效果
1. 透明
1.1 效果
1.2 代码
Button{
id: _mBtn
width: parent.width
height: parent.height
background: Rectangle{
id: _mBg
radius: 5
antialiasing: true
color: "white"
}
icon{
source: _mRoot._mIconSource
cache: false
color: "transparent" //透明
height: 40
width: 40
}
}
2. 设置具体颜色
2.1 效果
2.2 代码
Button{
id: _mBtn
width: parent.width
height: parent.height
background: Rectangle{
id: _mBg
radius: 5
antialiasing: true
color: "white"
}
icon{
source: _mRoot._mIconSource
cache: false
color: "#ef5350" //具体颜色
height: 40
width: 40
}
}
3. 其他对比
上面模糊,下面清晰。