Hello, I have a problem with a scrolling frame in a gun shop, it works perfectly on my screen, but when I use a smaller screen I cannot see all the frames in the scrolling frame.
If you’re using a UIListLayout object under the ScrollingFrame you can use UIListLayout.AbsoluteContentSize to get the size in pixels of the list:
A LocalScript can be used to automatically change the ScrollingFrame.CanvasSize to matched the AbsoluteContentSize:
local scrollingFrame = script.Parent
local listLayout = scrollingFrame.UIListLayout
-- Changes the CanvasSize to AbsoluteContentSize
local function updateFrame()
frame.CanvasSize = UDim2.new(0, 0, 0, listLayout.AbsoluteContentSize.Y)
end
-- Detect when the AbsoluteContentSize is changed and trigger the function
listLayout :GetPropertyChangedSignal("AbsoluteContentSize"):Connect(updateFrame)
updateFrame()