Help scaling an automatic scaling scrolling frame with an UIGridLayout added?

I am working on UI for my game, and part of the UI is an inventory system using a UIGridLayout. The problem with it is that, I am using the property AutomaticCanvasSize, which will automatically scale the canvas based off of the number of items within it. I am unable to use the Scale sizing for this, because upon using scale it will make my object scale to the size of the canvas not the frame, meaning it goes very small. I can’t have this, so I use offset, and so I tried to use UIAspectRatios which work for objects that use an UIListLayout. None of this worked.

Below is a picture of my UI, the size is 100x100, any way to fix this?

Normal UI:

Mobile UI:
image

2 Likes

I really don’t think there is, wasn’t aware that this would happen with AutomaticSize, going to have to switch some stuff to Offset for some of my UI lol. I would of thought Roblox would of set the CanvasSize to the AbsoluteSize of all the objects inside.

Have you tried getting the height AbsoluteSize of a row of elements (you can keep the elements using Scale instead of Offset btw), and multiple that based on how much rows of elements you have, and then using the Offset returned from that as the CanvasSize (make sure to also add the Offset of the horizontal padding between rows (if you have any horizontal padding) to the CanvasSize).

Sorry if I sound confusing, I would provide some code, but I’m on mobile right now. Hope this helps.

1 Like

I was able to sort of find a fix. For one, I converted the X axis to scale because I only use the Y axis for my canvas, and added the UIConstraints. This kind of fixed it, only problem being the UI now has horrible spacing for some reason.
image

2 Likes

Maybe UIAspectRatioConstraints will fix that issue?