Properly Size Cell Padding


    UIGridLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
        ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, UIGridLayout.AbsoluteContentSize.Y)
        UIGridLayout.CellPadding= UDim2.new(0,0,0,UIGridLayout.AbsoluteContentSize.Y/700)
    end)

I am having a problem when adding multiple frames the cell padding or positioning in y value starts increasing.

1 Like

have you tried using scale and not offset?

I am not sure how to exactly scale it. I am planning on doing it by scale.

Why are you changing the cell padding everytime the size is changed? I think that’s your issue, cell padding is how much space there is between elements and you should just keep it the same. If you want like 5 pixels of space between all elements you would just set the CellPadding once to UDim2.new(0, 0, 0, 5)

1 Like

I would just update the canvas size and parent normally the elements inside ur scrolling frame, no need to update cell padding, the canvas size line its perfect, what I’ve learn is that sometimes after modifying a scrolling frame layout a simple wait() before updating the canvas helps a lot. for personal experience with scrolling frames I prefer working with offset, in the rest i always use scale

Screen Shot 2021-01-20 at 8.06.45 AM The more frames the higher the spacing

Remove this line from your code

UIGridLayout.CellPadding= UDim2.new(0,0,0,UIGridLayout.AbsoluteContentSize.Y/700)

I already did. still won’t work

What is the CellPadding of your GridLayout in the explorer?

Screen Shot 2021-01-20 at 8.34.46 AM

Ok this actually helped. I made the offset higher instead of scale so no more spacing when adding THANK YOU.