Scrolling frame Issue

This might be a dumb question, but i didnt find anything related to this.
so im using a scrolling frame, with a ui grid inside, but some buttons started to get cut off
i tried to increasy the canvas size manually, but the buttons just got more spaced out and didnt fix the issue



I had this same issue. I managed to get around it by getting rid of the padding on the layout you are using.

However another workaround is that you could turn off ClipsDescendants on the scrolling Frame and add a UI padding to its parent. This would make it so that the scrolling frame is a little smaller however your icons should not be cut off. (I have not tested this but in theory it could work)

Please let me know if this works or if you find a different fix!

there are a lot of posts about this already, try using the devforum search bar or your browser’s

also this post would go in Art Design Support

instead of adjusting the canvas size, change AutomaticCanvasSize to Y.

now the scrolling frame will dynamically change based on its contents.

You can use a CanvasGroup to apply a transparency gradient on the canvas of the scrolling frame at the top (and bottom?), to make the cells appear gradually when scrolling (This is a bit annoying, as setting up the UIGradient is a bit of a pain). Alternatively, you can make the title slightly overlap the scrolling frame (by the size of the UICorner minimum), to hide the top edge of the scrolling frame. However, the title would have to be opaque, or not have a UICorner

That doesn’t always work though to fix the problem.

I’ve had this issue before for UIListLayouts inside of ScrollingFrames.
All I did was make my own CanvasSize updater that would calculate the needed size for the canvas including all the padding from the UIListLayout and any UIPadding inside the scrolling frame aswell.

I think I might actually have to do this as well, it’s so frustrating, it works perfectly fine in studio but when play testing and then playing in game the scrolling frame scrolls entirely different. I just don’t understand why it’s so bugged.

Yeah its quite annoying but this is one I made for 1 of my UI

local function ReSize(ScrollingFrame : ScrollingFrame)
	local TotalYSize = 0
	local YPaddingTop = if ScrollingFrame:FindFirstChildWhichIsA('UIPadding') then ScrollingFrame:FindFirstChildWhichIsA('UIPadding').PaddingTop.Scale else 0
	local Padding = if ScrollingFrame:FindFirstChildWhichIsA('UIListLayout') then ScrollingFrame:FindFirstChildWhichIsA('UIListLayout').Padding.Scale else 0
	
	YPaddingTop *= 2
	
	local AllFrames = {}

	for i, v in pairs(ScrollingFrame:GetChildren()) do
		if v:IsA('Frame') then
			table.insert(AllFrames, v)
		end
	end

	local TotalFrames = #AllFrames
	local TotalPadding = YPaddingTop + (Padding * TotalFrames)

	for i, v in pairs(AllFrames) do
		local Size: UDim2 = v.Size
		local Y = Size.Y
		local Scale = Y.Scale

		TotalYSize += Scale
	end

	local TotalSize = TotalYSize + TotalPadding
	ScrollingFrame.CanvasSize = UDim2.fromScale(0, TotalSize)
end
1 Like

How can i adapt this to my ui? Because none of the methods i tried worked and im using a UIGridLayout so idrk how to do it