Reputation: 729
I'm developing a new FMX project and I needed to use TFlowLayout.
There is no more space for current items count. I decided to use TVertScrollBox but its not working on it.
Is there any way to use TFlowLayout with vertical scroll?
Upvotes: 0
Views: 1851
Reputation: 29
To ensure scrolling of a FlowLayout inside the VertScrollBox set the FlowLayout.Align:=alTop not alClient, as in this case the Height of a Flowlayout will always be binded to the height of it's Parent. All content that exceeds this height will be cutted.
Upvotes: 0
Reputation: 608
Sure this works fine. To test, start a new blank FMX project, drop a TVertScrollBox on the form and drop a TFlowlayout inside the TVertScrollbox. Use the structure view to ensure that the TFlowlayout is inside the TVertscrollbox.
Now adjust the size of the TFlotlayout component and you will be able to scroll vertically even in the IDE.
I quickly tried this in Berlin 10.1 Update 2 and it works as expected.
You didn't post any code but if you are adding objects to your TFLowLayout at runtime you will need to create an AutoSize function that will adjust the height of the TFlowLayout to be large enough for all of its child objects and align the TFlowLayout to the top of the TVertScrollbox. If you can't figure out how to implement the AutoSize function I suggest you post a separate question with some sample code.
Upvotes: 7