Property: | Function: |
---|---|
Horizontal Fit | How the width is controlled. |
None | Do not drive the width based on the layout element. |
Minimum | Drive the width based on the minimum width of the layout element. |
Preferred | Drive the width based on the preferred width of the layout element. |
Vertical Fit | How the height is controlled. |
None | Do not drive the height based on the layout element. |
Minimum | Drive the height based on the minimum height of the layout element. |
Preferred | Drive the height based on the preferred height of the layout element. |
The Content Size Fitter functions as a layout controller that controls the size of its own layout element. The size is determined by the minimum or preferred sizes provided by layout element components on the Game Object. Such layout elements can be Image or Text components, layout groups, or a Layout Element component.
It’s worth keeping in mind that when a Rect Transform is resized - whether by a Content Size Fitter or something else - the resizing is around the pivot. This means that the direction of the resizing can be controlled using the pivot.
For example, when the pivot is in the center, the Content Size Fitter will expand the Rect Transform out equally in all directions. And when the pivot is in the upper left corner, the Content Size Fitter will expand the Rect Transform down and to the right.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information