Class ContentSizeFitter
Inherited Members
Component.GetComponentIndex()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Scene)
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: UnityEngine.UI
Assembly: UnityEngine.UI.dll
Syntax
[AddComponentMenu("Layout/Content Size Fitter", 141)]
[ExecuteAlways]
[RequireComponent(typeof(RectTransform))]
public class ContentSizeFitter : UIBehaviour, ILayoutSelfController, ILayoutController
Constructors
ContentSizeFitter()
Declaration
protected ContentSizeFitter()
Fields
m_HorizontalFit
Declaration
[SerializeField]
protected ContentSizeFitter.FitMode m_HorizontalFit
Field Value
Type | Description |
---|---|
ContentSizeFitter.FitMode |
m_VerticalFit
Declaration
[SerializeField]
protected ContentSizeFitter.FitMode m_VerticalFit
Field Value
Type | Description |
---|---|
ContentSizeFitter.FitMode |
Properties
horizontalFit
The fit mode to use to determine the width.
Declaration
public ContentSizeFitter.FitMode horizontalFit { get; set; }
Property Value
Type | Description |
---|---|
ContentSizeFitter.FitMode |
verticalFit
The fit mode to use to determine the height.
Declaration
public ContentSizeFitter.FitMode verticalFit { get; set; }
Property Value
Type | Description |
---|---|
ContentSizeFitter.FitMode |
Methods
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Declaration
protected override void OnEnable()
Overrides
OnRectTransformDimensionsChange()
This callback is called when the dimensions of an associated RectTransform change. It is always called before Awake, OnEnable, or Start. The call is also made to all child RectTransforms, regardless of whether their dimensions change (which depends on how they are anchored).
Declaration
protected override void OnRectTransformDimensionsChange()
Overrides
OnValidate()
Declaration
protected override void OnValidate()
Overrides
SetDirty()
Declaration
protected void SetDirty()
SetLayoutHorizontal()
Calculate and apply the horizontal component of the size to the RectTransform
Declaration
public virtual void SetLayoutHorizontal()
SetLayoutVertical()
Calculate and apply the vertical component of the size to the RectTransform
Declaration
public virtual void SetLayoutVertical()