Game Development Reference
In-Depth Information
° In the following example, the topmost element has a
Preferred
Width
set to
50
and its width is smaller than the bottommost
element, which has not been set. With the parent
Rect Transform
set to
100
, the topmost element has not scaled up past its maximum
to match its parent:
The topmost child element overrides the layout and does not grow bigger
•
Preferred Height
: The preferred width property defines the largest height
that the
Rect Transform
for the child element in a layout group will scale up
to. If the layout group's
Rect Transform
height is increased, the control will
not scale up any more beyond this value. Its height however, will scale lower
than this value.
Remember, if you have left the default options on the group
for
Child Force Expand
, it will override any
Preferred
settings of the
Layout Element
, forcing the UI element to take
up the maximum space available within the group.