I’m trying to add multiple frames in a scrolling frame with an automatic canvas size and a ui list layout. The problem is that if I have an ui aspect ratio in the frames, the automatic canvas size doesn’t work correctly:
WITH ui aspect ratio:
WITHOUT ui aspect ratio:
as you can see the second one has the bar visible on the right and can be scrolled through where as the first one cannot.
Here is the scrolling frame properties:
I didn’t fiddle with using both at the same time because I never myself use AspectRatioConstraints unless I’m scaling it in Scale. So, I never use Scale to size my GUIs if they’re just going to need an AspectRatioConstraint right after.
I want to know what happens if you put AutomaticCanvasSize to XY.
For some odd reason it seems to only work with UIGridLayout, it’s very odd, to make sure it’s that I had a scrolling frame with uigridlayout and uilistlayout with the same children and tested it ingame only the uilistlayout didnt work as expected and once i removed the aspect ratio from the children it all of a sudden worked
Theese 2 scrolling frames have “ClipsDescendants” set to true, “AutomaticCanvasSize” set to Y and “CanvasSize” set to 0. Second frame has all the elements put in a frame with “AutomaticSize” set to Y:
and it scaled perfectly fine but the scrolling frame still didnt worked so i added a script inside the frame that sets the canvas size everytime its absolute size changed (also i turned off AutomaticCanvasSize):
local Scrolling = script.Parent
local Frame = Scrolling:WaitForChild("Frame")
Frame.Changed:Connect(function(Property)
if Property == "AbsoluteSize" then
print(Frame.AbsoluteSize.Y)
Scrolling.CanvasSize = UDim2.new(0,0,0,Frame.AbsoluteSize.Y)
end
end)
and that fixed the problem. Here is a video showin how it works in game: