UIGridlayout and scrolling frame working together

I was wondering if it is possible to use a UIGridLayout for like items in your game, so the more items you get, it will use the scrolling frame to scroll down to see more items, I was able to KINDA get this to work, but the problem it has was that the uigridlayout didn’t extend the bottom of the frame like it is supposed to.

any helpful information on how to do this would be great!

1 Like

UIGridLayout only reorganises your Gui elements, it does not change the properties of a ScrollingFrame. You will have to manually code this behaviour yourself by multiplying the number of elements in your frame by a specific value (i.e. if all your buttons have a Y-height of 55, then #ScrollingFrame:GetChildren() * 55) and then set that value as the Y value of CanvasSize.

It is possible to use both though, yes.

2 Likes

So I tried this and these are my results, https://gyazo.com/5fa26f06137683a2e1b620347d95d8b7
is it possible to make it so it will go down the whole object?

1 Like

Use UIGridLayout’s AbsoluteContentSize feature instead. Set the ScrollingFrame’s CanvasSize to this and it shouldn’t have any blank space and takes padding into account.

8 Likes

Ninja’d by above.

Oh my, excuse me. I was thinking of UIListLayout. The solution I provided you would’ve worked for UIListLayout, not UIGridLayout.

There is a AbsoluteContentSize property, with a code example that shows you what you can do to expand your ScrollingFrame to meet your grid. Try having a look.

1 Like