我有一个流量,远远超过屏幕底部。所以我把它包在了ScrollView中;然而,我就是不能让它工作。
一个(小)问题是,将contentWidth设置为parent.width以外的任何值都会导致流不显示任何内容。我不应该设置contentWidth/contentHeight,因为scrollView只包含一个项目。(但不设置这些会导致scrollView为空)。
主要问题是视图不可滚动(一旦我显示了内容)。我可以在底部看到内容截断,但我无法用鼠标上下拖动它,也不会出现滚动条。怎么了?
Rectangle {
anchors {
top: buttons.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
ScrollView {
clip: true
contentHeight: gatewayFlow.implicitHeight
contentWidth: parent.width // availableWidth // gatewayFlow.implicitWidth
Flow {
id: gatewayFlow
anchors.fill: parent
spacing: 10
Gateway { }
Gateway { }
Gateway { }
Gateway { }
Gateway { }
Gateway { }
Gateway { }
Gateway { }
Gateway { }
} // Flow
} // ScrollView
} // Rectange