ScrollingFrame elements do weird stuff for whatever reason

So I made a little radio using the GUI provided to me.
Its based on scrolling frames and I set the canvas size to X: 0 Y: 9999999999999999999999
So that there is a lot of space to scroll. (The previous version didn’t have a lot of it so it just cut off)
So does anyone know how I can make the text stay in bounds?

1 Like

Do you mean you want to be able to scroll further down? For that use CanvasSize.
I’m guessing for this example you should make it {0,0,0,9999} (but keep going with the 9s)

1 Like

No, I mean that when I make it 999999 as you can see in the image the text goes outside of the frame.

Oh, I get what you mean now. Are you sure that the TextLabel’s position is actually lower than the size of the Canvas?

I can’t really change the position because UIListLayout does it.

In that case, though should scale the CanvasSize using the AbsoluteContentSize of the UIListLayout.
This code should work:

local frame = script.Parent.ScrollingFrame
local layout = frame.UIListLayout

local updateSize = function()
    frame.CanvasSize = UDim2.new(0,layout.AbsoluteContentSize.X,0,layout.AbsoluteContentSize.Y
end
updateSize()

You should call the updateSize function whenever a child is added/removed