You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want the boxes to be contained as much as possible, altought the outer frame doesn’t have to be the same aspect ratio.
Show the GUI structure. Those two elements probably have different scale values. If you want them to be the same size then they should be nested or have the same scale values.
I had the same problem as well when making an inventory system. The problem is that your cell size is using offset (pixel measurements) while your UI is using scale (screen size %) measurements. To fix this, either use scale for your cell size (which is unadvisable), use offset for your UI size, or put a UIAspectRatioConstant inside the UI and use scale for your cell sizing.
It’s a pretty simple issue: Roblox doesn’t make the gui’s size offset to screen when you instance one, you have to do it manually, which is quite simple:
Before doing anything, make sure each Frame or part od the UI has position and size set to scale, not offset. Offset is bad cause different screen sizes will result in a different appearance. Scale on the other hand adjusts it to the screen’s size