该border属性Rectangle允许您为元素添加边框.问题是您不能仅显示左边界或右边界.要做到这一点,你必须在Rectangle中添加额外的元素来表示边框.
Rectangle {
width: 100
height: 200
color: "blue"
Rectangle {
id: borderLeft
width: 1
height: parent.height
anchors.left: parent.left
color: "red"
}
Rectangle {
id: borderRight
width: 1
height: parent.height
anchors.right: parent.right
color: "red"
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
282 次 |
| 最近记录: |