UiGridLayout children different sizes on different devices

Hello, I am trying to create an inventory Ui with a scrolling frame. I am using a UiGridLayout to position all the items correctly, It works fine on PC but when switching to mobile the frames inside the scrolling frame are a different size, How can I fix this so they are the same on all devices?

PC:

Mobile:
image

Are you using the proper sizing? i.e scale instead of offset

Sorry I dont do much gui designing, I just scaled it with the cell size in the uigridlayout.

UIGridLayout has a property called “CellSize”. This one stores a UDim2 value. UDim2 Values are composed of 2 “sections”, the X axis and the Y axis, and each axis has another 2 sections: Scale and Offset.

Scale is like percentages. If you set it to 0.5, it’ll occupy 50% of its parent. However, Offset works with pixels, meaning if set to 50, it’ll occupy 50 pixels.

In the CellSize property you probably used Offset values, which makes this effect.

{0, 0},{0, 0}
X Axis, Y Axis
{Scale, Offset}, {Scale, Offset}

This kind of scale-offset system also appears with the padding, so use scale instead of offset on both padding and cell size. Try playing around until they fit.

1 Like

Thank you so much, I’ll try that out when I get home and mark your post as a solution if it works.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.