我想使用qml禁用gridview中的拖动 . 这就是我现在所拥有的
GridView {
id: appGridView
anchors.fill: parent
cellWidth: (appGridView.width / 2) ; cellHeight: 210
focus: true
model: proxyModel
delegate: AppGridDelegate{}
clip: true
}
请注意,flickable的拖动属性是只读的 .
更新:
当我按下鼠标并向上/向下拖动视图时,我不希望移动gridview . 只有在轻弹网格视图时才应该进行移动 . 基本上我为什么要这样做是因为当我选择一个项目时,我刷新模型以显示对UI的更改 . 现在,刷新模型时,当前的contentY位置会发生变化,视图会向上移动 .
1 回答
要使可擦除的flickable行为,您可以将interactive设置为false . This property describes whether the user can interact with the Flickable. A user cannot drag or flick a Flickable that is not interactive.