Layout component reference
Layout is a container component. The container can unlock the auto-layout function to automatically arrange all the sub-objects according to the specifications so that the user can use it to make list, page turning and other functions conveniently.
Click the Add Component button at the bottom of Properties panel and then select Layout from the UI Component to add the Layout component to the node.
|Layout type, currently has NONE, HORIZONTAL, VERTICAL and Grid.
|Resize strategies, currently has NONE, CHILDREN and CONTAINER.
|The left padding between the sub-object and the container frame in the layout.
|The right padding between the sub-object and the container frame in the layout.
|The top padding between the sub-object and the container frame in the layout.
|The bottom padding between the sub-object and the container frame in the layout.
|The separation distance between sub-objects in the horizontal layout. NONE mode doesn't have this attribute.
|The separation distance between sub-objects in the vertical layout. NONE mode doesn't have this attribute.
|When it is designated as horizontal layout, which side does the first child node start in the layout? The left or the right?
|When it is designated as vertical layout, which side does the first child node start in the layout? The upside or the downside?
|This option is only available in Grid layout, Children resize mode. The size of each child element.
|This option is only available in Grid layout, the arrangement direction of children elements.
|Affected By Scale
|Whether the scaling of the child node affects the layout.
The default layout type is NONE after adding the Layout component. It indicates that the container won't change size and location of the sub-object. When the user places sub-object manually, the container will take the minimum rectangular region that can contain all the sub-objects as its own size.
You can switch the layout container type by altering
Type in Properties panel, all the layout types support
When Resize Mode is NONE, the container and sub-objects' size is independent of each other.
When Resize Mode is CHILDREN, the sub-objects' size will change with container's size.
When Resize Mode is CONTAINER, the container's size will change with sub-objects' size.
When using Grid layout, the Start Axis is very important. When choosing HORIZONTAL, it will fill an entire row before a new row is started. When choosing VERTICAL, it will fill an entire column before a new column is started.
- Scaling and rotation of child nodes are not considered.
- After setting the Layout, the results need to be updated until the next frame, unless you manually call