ScrollingFrame & UIGridLayout

I use frame templates which are cloned in the scrolling frame. I didn’t touch the offset of ui elements, but rather the size (for frame)

I did the same with uigridlayout i used size and not offset.

Is it possible to somehow define how much the scrolling frame can go?

This is what i tried:

local gridLayout = ScrollingFrame:FindFirstChildOfClass("UIGridLayout")
if gridLayout then
    local contentSize = gridLayout.AbsoluteContentSize
    ScrollingFrame.CanvasSize = UDim2.new(0, contentSize.X, 0, contentSize.Y)
end

But it doesnt solve the issue and only ends up stretching my frames.

1 Like

you can set the scrollingframe’s automaticcanvassize to y and set the canvassize to {0, 0},{0, 0} (UDim2.new(0, 0, 0, 0))

edit: oh sorry are you trying to define how much the scrolling frame can go? cuz the post says so

Anything that helps me fit in all the gui elements that get cloned inside will help… or if there’s a way to pre-define how much scrolling frame goes, that would work as well

just do what i said in the reply if u wanna fit all the elements

The frames are being stretched as it goes off the CanvasSize rather than the scrolling frames size. Using offset should fix the frames being stretched

the reason why i did not want to use offset is because the elements become bigger on mobile. i want them to keep the size, whereas using the size always helped me.

thank you… i set it to Y and had to edit my uigridlayout in order to scale them back to normal size (templates)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.