一个非常简单的ListView的例子
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import QtQuick.Window 2.2
Window {
visible: true
width: 300
height: 450
title: qsTr("Hello World")
ListView{
id:listView
anchors.fill: parent
width: 300
height:45
model: 20
highlightFollowsCurrentItem:true
highlightMoveVelocity:80
snapMode: ListView.SnapOneItem
delegate: Rectangle{
width: listView.width /3
height: listView.height /4
color: index%2 ? "red":"yellow"
Label{
anchors.centerIn: parent
font.pointSize: 10
text: index
}
}
}
}
网上说可以通过highlightMoveVelocity控制滑动的速度哦,但是我试了一下不行呀,怎么才能改变滑动的速度?