GUI List not behaving properly

So I’m trying to make this update log GUI which shows the latest logs via datastore functions, and there’s a table with information (multiple labels inside of a scrollingframe). I wrote a simple script to make it work correctly, but the scaling is off.
When you add more TextLabels, it stretches further.
image
I’ve added a TextSizeConstraint which makes it look better, but it has huge spaces inbetween.
image
Script:

local List = script.Parent:WaitForChild("UIListLayout")

function CanSize()
	script.Parent.CanvasSize = UDim2.new(0, 0, 0, List.AbsoluteContentSize.Y)
end

script.Parent.ChildAdded:Connect(CanSize)
script.Parent.ChildRemoved:Connect(CanSize)

Is there any way I could fix this?

This isn’t really a scripting question; however, can be scripted if you wanted it to be.

You can achieve the same outcome by simply using a UIGridLayout for the correction of this issue.

Wrong. This is indeed a scripting question. That’s why the script is there.
Using a grid layout still gives me the same results.
image
The script is so I can scale the logs correctly.
More than 10 labels:
image

If you use the UIGridLayout object you can simply use this to correct the gap issue.

UI.CanvasSize = UDim2.new(0,0,0,UIGridLayout.AbsoluteContentSize.Y)

It appears you’re using scale and not offset on the Y axis for the TextBox.

That’s indeed what I did. The script is linked in the OP.

I can’t see the background of the TextBox but if you could let me know if the size is using scale or offset it would help me understand your issue.

I’m using offset. Please read the script if you have not already.

Please take a moment and read what I said…

I’m referring to TextBox.

What TextBox? I’m unsure what you’re talking about. Is this something I need? Because I’m using TextLabels.

The TextLabel is using Scale, the CanvasSize on the ScrollingFrame is using offset, to explain further.

Yeah TextLabels, just tell me if the size is using offset or scale on the Y axis.

image

try using this:
script.Parent.CanvasSize = UDim2.new(0,0,math.floor(#List.Parent:GetChildren()/6),0)

1 Like

That’s not the problem, currently. The scaling on the text is off. Please look at the images.

image
^ TextLabel
Y axis for CanvasSize is offset.

Great, change the Y to offset not scale.

What exactly are you wanting me to do with the Y offset?

Your text has big gaps because it’s going off Y size.
As you add more it add more overall scale, in turn the Y is scaled.

(Needs to be offset.)

1 Like

are you using UIListLayout or UIGridLayout?

That makes more sense. Thank you for the help.

Pretty sure they aren’t there isn’t a red explanation next to the size photo they posted.

I am using a UIListLayout for the GUI.