properly setting size of Flickable for ScrollBar
-
Hi all -
I'm implementing a Flickable with ScrollBar. The ScrollBar doesn't reflect the actual size of the stuff in the Flickable - it just shows as completely visible. I think I'm doing something wrong with my size settings of the Flickable. Here's a minimal code snippet:
ColumnLayout { anchors.fill: parent Flickable { id: flickable Layout.fillHeight: true Layout.fillWidth: true clip: true contentHeight: pumpStuff.height ColumnLayout { id: pumpStuff height: parent.height width: flickable.width - (scroller.width * 2) // lots of stuff here, not all of which shows up. } ScrollBar.vertical: ScrollBar { id: scroller policy: ScrollBar.AlwaysOn//AsNeeded } } }
Can someone tell me what I'm doing wrong with this?
Thanks...
-
Hi! I am not sure, but I think your ColumnLayout doesn't need explicit height. It seems like your ColumnLayout is the same height as flickable, that's why scrollbar doesn't reflect actual size. So the possible solution could be removing height: parent.height and see if it works.
-
Hi! I am not sure, but I think your ColumnLayout doesn't need explicit height. It seems like your ColumnLayout is the same height as flickable, that's why scrollbar doesn't reflect actual size. So the possible solution could be removing height: parent.height and see if it works.