Solved Scrolling a ColumnLayout
-
In my code, I have something like the following:
ScrollView { clip: true ColumnLayout { spacing: 10 anchors.fill: parent Label { text: "..." } // there are 13 of these in my case } }
Unfortunately, this does not work as expected. Instead of providing a scrollable view that will allow me to view all of the labels when the window isn't very tall, the labels just run off the screen and won't scroll at all.
To make things more complex, I've got the ScrollView in a ColumnLayout. I don't know if this would have any effect, though.
How should I be programming this so that it will scroll?
-
hi
[EDIT] Did you give a size (height/width) to your ScrollView ? -
@LeLev setting
Layout.preferrredWidth
andLayout.preferrredHeight
on the ScrollView (remember it's in a ColumnLayout) worked, but I'd really like if I could have the width and height automatically fill the available space.Edit: Oddly, enough, setting
Layout.fillWidth
andLayout.fillHeight
totrue
fixed the problem. -