Game Development Reference
In-Depth Information
Flexible Height : The flexible height property (same as the width) can be
best be described as a height percentage of the containing group's Rect
Transform . Defined as a number between 0 and 1 to indicate the percentage.
Remember, if you have left the default options as the group
for Child Force Expand , it will override any flexible settings
of the Layout Element , forcing the UI element to take up the
maximum space available within the group.
° In the following example, the leftmost element has a Flexible
Height applied at 0.8 (80 percentage) and its height is less than
the right-hand element which has not been set:
The leftmost child element overrides the layout and only takes up 80% of the available height
Content Size Fitter
Seeing the need to constrain the Rect Transform for a layout group's based on its
content (instead of fitting the child elements to the group, which is the default)
Unity created the Content Size Fitter component. When attached to a layout group,
the Content Size Fitter will automatically manage the bounds of the Rect Transform
for the group so that it will resized based on the dimensions of its children.
For the Content Size Fitter to function, it needs to have child controls that support
minimum or preferred layout size settings such as text or an image (or any other
control deriving from the ILayoutElement interface). It can also be used with other
layout groups.
 
Search WWH ::




Custom Search