我遇到ListView的问题。 ListView太长,并且它的一部分出现在窗口之外,但我无法附加滚动条。我尝试了许多不同的组合。我认为这个问题在于高度参数,但是如果删除它,ListView只显示第一个条目。QML:将滚动条连接到ListView
Column{
anchors.fill: parent
Row{
id: buttonsRow
Button{
text: "Open dump file"
onClicked: fileDialog.visible = true
}
Button{
text: "Copy raw data to clipboard"
}
}
ListView{
id: listView
anchors.top: buttonsRow.bottom
height: contentHeight
//clip: true
flickableDirection: Flickable.VerticalFlick
boundsBehavior: Flickable.StopAtBounds
interactive: true
model: ListModel{
id: listModel
}
delegate: MDelegate{}
}
}
有什么办法让它滚动吗?
谢谢“附加滚动条到Flickable”!现在滚动工作正常。 – Marzanna