import QtQuick 2.0
import QtQuick.Controls 2.1
Rectangle {
id: rect
width: 1920
height:1180
color:"black"
ListView {
id: list_view
anchors.fill:parent
model: 16 //16个model
delegate: Rectangle { x:0; y:0;width: 300; height: 50; //代理
border.color: 'grey' }
spacing: 6
ScrollBar.vertical: ScrollBar { //滚动条
anchors.right: lview.left
width: 50
active: true
background: Item { //滚动条的背景样式
Rectangle {
anchors.centerIn: parent
height: parent.height
width: parent.width * 0.2
color: 'grey'
radius: width/2
}
}
contentItem: Rectangle {
radius: width/3 //bar的圆角
color: 'yellow'
}
}
}
}
QML ListView 实现 滚动条方式
最新推荐文章于 2024-07-01 08:30:00 发布