LayoutElement
Inherited MembersComponent.GetComponentIndex()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, InstantiateParameters)
Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
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/Layout Element", 140)]
[RequireComponent(typeof(RectTransform))]
[ExecuteAlways]
public class LayoutElement : UIBehaviour, ILayoutElement, ILayoutIgnorer
Constructors LayoutElement() Declaration
protected LayoutElement()
Properties flexibleHeight
The extra relative height this layout element should be allocated if there is additional available space.
Declarationpublic virtual float flexibleHeight { get; set; }
Property Value flexibleWidth
The extra relative width this layout element should be allocated if there is additional available space.
Declarationpublic virtual float flexibleWidth { get; set; }
Property Value ignoreLayout
Should this RectTransform be ignored by the layout system?
Declarationpublic virtual bool ignoreLayout { get; set; }
Property Value layoutPriority
The Priority of layout this element has.
Declarationpublic virtual int layoutPriority { get; set; }
Property Value minHeight
The minimum height this layout element may be allocated.
Declarationpublic virtual float minHeight { get; set; }
Property Value Examples
using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when using UI elements.
public class ExampleClass : MonoBehaviour
{
public Transform MyContentPanel;
//Sets the flexible height on on all children in the content panel.
public void Start()
{
//Assign all the children of the content panel to an array.
LayoutElement[] myLayoutElements = MyContentPanel.GetComponentsInChildren<LayoutElement>();
//For each child in the array change its LayoutElement's minimum height size to 64.
foreach (LayoutElement element in myLayoutElements)
{
element.minHeight = 64f;
}
}
}
minWidth
The minimum width this layout element may be allocated.
Declarationpublic virtual float minWidth { get; set; }
Property Value Examples
using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when using UI elements.
public class ExampleClass : MonoBehaviour
{
public Transform MyContentPanel;
//Sets the flexible height on on all children in the content panel.
public void Start()
{
//Assign all the children of the content panel to an array.
LayoutElement[] myLayoutElements = MyContentPanel.GetComponentsInChildren<LayoutElement>();
//For each child in the array change its LayoutElement's minimum width size to 200.
foreach (LayoutElement element in myLayoutElements)
{
element.minWidth = 200f;
}
}
}
preferredHeight
The preferred height this layout element should be allocated if there is sufficient space.
Declarationpublic virtual float preferredHeight { get; set; }
Property Value Examples
using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when using UI elements.
public class ExampleClass : MonoBehaviour
{
public Transform MyContentPanel;
//Sets the flexible height on on all children in the content panel.
public void Start()
{
//Assign all the children of the content panel to an array.
LayoutElement[] myLayoutElements = MyContentPanel.GetComponentsInChildren<LayoutElement>();
//For each child in the array change its LayoutElement's preferred height size to 100.
foreach (LayoutElement element in myLayoutElements)
{
element.preferredHeight = 100f;
}
}
}
preferredWidth
The preferred width this layout element should be allocated if there is sufficient space. The preferredWidth can be set to -1 to remove the size.
Declarationpublic virtual float preferredWidth { get; set; }
Property Value Examples
using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when using UI elements.
public class ExampleClass : MonoBehaviour
{
public Transform MyContentPanel;
//Sets the flexible height on on all children in the content panel.
public void Start()
{
//Assign all the children of the content panel to an array.
LayoutElement[] myLayoutElements = MyContentPanel.GetComponentsInChildren<LayoutElement>();
//For each child in the array change its LayoutElement's preferred width size to 250.
foreach (LayoutElement element in myLayoutElements)
{
element.preferredWidth = 250f;
}
}
}
Methods CalculateLayoutInputHorizontal()
After this method is invoked, layout horizontal input properties should return up-to-date values. Children will already have up-to-date layout horizontal inputs when this methods is called.
Declarationpublic virtual void CalculateLayoutInputHorizontal()
CalculateLayoutInputVertical()
After this method is invoked, layout vertical input properties should return up-to-date values. Children will already have up-to-date layout vertical inputs when this methods is called.
Declarationpublic virtual void CalculateLayoutInputVertical()
OnBeforeTransformParentChanged() Declaration
protected override void OnBeforeTransformParentChanged()
Overrides OnDidApplyAnimationProperties() Declaration
protected override void OnDidApplyAnimationProperties()
Overrides OnDisable() Declaration
protected override void OnDisable()
Overrides OnEnable() Declaration
protected override void OnEnable()
Overrides OnTransformParentChanged() Declaration
protected override void OnTransformParentChanged()
Overrides OnValidate() Declaration
protected override void OnValidate()
Overrides SetDirty()
Mark the LayoutElement as dirty.
Declarationprotected void SetDirty()
Implements
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4