Legacy Documentation: Version 4.6.2
Language: English
Vertical Layout Group
Legacy GUI

Grid Layout Group

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Properties

Property: Function:
Padding The padding inside the edges of the layout group.
Cell Size The size to use for each layout element in the group.
Spacing The spacing between the layout elements.
Start Corner The corner where the first element is located.
Start Axis Which primary axis to place elements along. Horizontal will fill an entire row before a new row is started. Vertical will fill an entire column before a new column is started.
Child Alignment The alignment to use for the layout elements if they don’t fill out all the available space.

Description

The Grid Layout Group component places its child layout elements in a grid. Unlike other layout groups, the Grid Layout Group ignore the minimum, preferred, and flexible size properties of its contained layout elements and instead assign a fixed size to all of them which is defined in the properties of the Grid Layout Group itself.

Note: As a layout element, the Grid Layout Group will always set its preferred width to be the width needed to have all the layout elements be positioned side by side, regardless of what the Start Axis property is set to. Since the auto layout system always evaluates widths first and heights afterwards, it’s not possible to calculate a needed width given a constrained height.

Vertical Layout Group
Legacy GUI