Content Size Fitter

The Content Size Fitter component allows you to force the size of the parent to fit around the size of its children. This fitting can be based on the minimum or preferred size of the children.

To add a Content Size Fitter component to a UI object, select Add Component | Layout | Content Size Fitter from within the object's Inspector. The Content Size Fitter component has the following properties:

You can choose the following properties for the Horizontal Fit and the Vertical Fit:

If the Unconstrained property is selected, ...

Get Mastering UI Development with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.