StretchToParentSize(VisualElement)
Aligns a VisualElement's left, top, right and bottom edges with the corresponding edges of its parent.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
public static void StretchToParentSize(this VisualElement elem)
Parameters
The element to be aligned with its parent
Remarks
This method provides a way to set the following styles in one operation:
-
IStyle.position is set to Position.Absolute
-
IStyle.left is set to 0
-
IStyle.top is set to 0
-
IStyle.right is set to 0
-
IStyle.bottom is set to 0