docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SplitView

    A SplitView is a visual element that can be used to split its children into panes. A SplitView can be either horizontal or vertical, and it will have splitters between the panes. This component can contain any number of Pane elements as children.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BaseVisualElement
    SplitView
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    IAdditionalDataHolder
    Inherited Members
    BaseVisualElement.contextPrefix
    BaseVisualElement.scaleOverride
    BaseVisualElement.themeOverride
    BaseVisualElement.langOverride
    BaseVisualElement.layoutDirectionOverride
    BaseVisualElement.preferredTooltipPlacementOverride
    BaseVisualElement.tooltipDelayMsOverride
    BaseVisualElement.GetLayoutDirectionUssClassName(Dir)
    VisualElement.disabledUssClassName
    VisualElement.ExecuteDefaultAction(EventBase)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    public class SplitView : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder

    Constructors

    SplitView()

    Default constructor.

    Declaration
    public SplitView()
    See Also
    Pane
    Splitter

    SplitView(Direction)

    Construct a SplitView with the given direction.

    Declaration
    public SplitView(Direction direction)
    Parameters
    Type Name Description
    Direction direction

    The direction of the SplitView.

    See Also
    Pane
    Splitter

    Fields

    directionUssClassName

    The USS class name of the SplitView with a specific direction.

    Declaration
    public const string directionUssClassName = "appui-splitview--direction-"
    Field Value
    Type Description
    string
    See Also
    Pane
    Splitter

    firstItemUssClassName

    The USS class name of the first child element of the SplitView.

    Declaration
    public const string firstItemUssClassName = "appui-splitview__item--first"
    Field Value
    Type Description
    string
    See Also
    Pane
    Splitter

    itemUssClassName

    The USS class name of a child element of the SplitView.

    Declaration
    public const string itemUssClassName = "appui-splitview__item"
    Field Value
    Type Description
    string
    See Also
    Pane
    Splitter

    lastItemUssClassName

    The USS class name of the last child element of the SplitView.

    Declaration
    public const string lastItemUssClassName = "appui-splitview__item--last"
    Field Value
    Type Description
    string
    See Also
    Pane
    Splitter

    paneContainerUssClassName

    The USS class name of the pane container.

    Declaration
    public const string paneContainerUssClassName = "appui-splitview__pane-container"
    Field Value
    Type Description
    string
    See Also
    Pane
    Splitter

    splitterContainerUssClassName

    The USS class name of the splitter container.

    Declaration
    public const string splitterContainerUssClassName = "appui-splitview__splitter-container"
    Field Value
    Type Description
    string
    See Also
    Pane
    Splitter

    ussClassName

    The USS class name of the SplitView.

    Declaration
    public const string ussClassName = "appui-splitview"
    Field Value
    Type Description
    string
    See Also
    Pane
    Splitter

    withExpandButtonsUssClassName

    The USS class name of the SplitView with expand buttons.

    Declaration
    public const string withExpandButtonsUssClassName = "appui-splitview--with-expand-buttons"
    Field Value
    Type Description
    string
    See Also
    Pane
    Splitter

    Properties

    contentContainer

    Child elements are added to it, usually this is the same as the element itself.

    Declaration
    public override VisualElement contentContainer { get; }
    Property Value
    Type Description
    VisualElement
    Overrides
    VisualElement.contentContainer
    See Also
    Pane
    Splitter

    direction

    The direction of the SplitView. A horizontal SplitView will have the splitters between the panes be vertical, and a vertical SplitView will have the splitters between the panes be horizontal.

    Declaration
    public Direction direction { get; set; }
    Property Value
    Type Description
    Direction
    See Also
    Pane
    Splitter

    paneCount

    The number of panes in the SplitView.

    Declaration
    public int paneCount { get; }
    Property Value
    Type Description
    int
    See Also
    Pane
    Splitter

    realtimeResize

    Whether the SplitView should resize in real-time or not.

    When set to true, the SplitView will resize the panes as the user drags the splitter. When set to false, the SplitView will only resize the panes when the user releases the dragged splitter.

    Declaration
    public bool realtimeResize { get; set; }
    Property Value
    Type Description
    bool
    See Also
    Pane
    Splitter

    showExpandButtons

    Whether the SplitView should show expand buttons or not.

    Declaration
    public bool showExpandButtons { get; set; }
    Property Value
    Type Description
    bool
    See Also
    Pane
    Splitter

    splitterCount

    The number of splitters in the SplitView.

    Declaration
    public int splitterCount { get; }
    Property Value
    Type Description
    int
    See Also
    Pane
    Splitter

    Methods

    AddPane(Pane)

    Add a pane to the SplitView.

    Declaration
    public void AddPane(Pane pane)
    Parameters
    Type Name Description
    Pane pane

    The pane to add.

    See Also
    Pane
    Splitter

    CollapseSplitter(int, CollapseDirection)

    Collapse the splitter at the given index in the given direction.

    Declaration
    public void CollapseSplitter(int index, CollapseDirection collapseDirection)
    Parameters
    Type Name Description
    int index

    The index of the splitter.

    CollapseDirection collapseDirection

    Whether to collapse the splitter forward or not.

    Remarks

    Collapsing forward means that the splitter will move towards the next splitter in the current layout direction (in Left-to-Right or Top-to-Bottom layout, forward means right or down, respectively).

    If the splitter is already collapsed, this method does nothing.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if the index is out of range.

    See Also
    Pane
    Splitter

    ExpandSplitter(int)

    Expand the splitter at the given index (if it is collapsed).

    Declaration
    public void ExpandSplitter(int index)
    Parameters
    Type Name Description
    int index

    The index of the splitter.

    Remarks

    If the splitter is not collapsed, this method does nothing.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if the index is out of range.

    See Also
    Pane
    Splitter

    GetLegalSplitterPosition(int, float)

    Get the legal position of the splitter at the given index.

    Declaration
    public float GetLegalSplitterPosition(int index, float desiredPosition)
    Parameters
    Type Name Description
    int index

    The index of the splitter.

    float desiredPosition

    The desired position of the splitter.

    Returns
    Type Description
    float

    The legal position of the splitter.

    See Also
    Pane
    Splitter

    GetOrientationUssClassName(Direction)

    Declaration
    public static string GetOrientationUssClassName(Direction enumValue)
    Parameters
    Type Name Description
    Direction enumValue
    Returns
    Type Description
    string
    See Also
    Pane
    Splitter

    GetRange(int, out float, out float)

    Get the range of the splitter at the given index.

    Declaration
    public void GetRange(int index, out float min, out float max)
    Parameters
    Type Name Description
    int index

    The index of the splitter.

    float min

    The minimum position of the splitter.

    float max

    The maximum position of the splitter.

    Remarks

    The returned value depends on the current layout direction of the SplitView.

    See Also
    Pane
    Splitter

    IndexOfPane(Pane)

    Get the index of the given pane.

    Declaration
    public int IndexOfPane(Pane pane)
    Parameters
    Type Name Description
    Pane pane

    The pane to get the index of.

    Returns
    Type Description
    int

    The index of the pane. -1 if the pane is not found.

    See Also
    Pane
    Splitter

    InsertPane(int, Pane)

    Insert a pane at the given index.

    Declaration
    public void InsertPane(int index, Pane pane)
    Parameters
    Type Name Description
    int index

    The index to insert the pane at.

    Pane pane

    The pane to insert.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if the index is out of range.

    See Also
    Pane
    Splitter

    IsSplitterCollapsed(int)

    Whether the splitter at the given index is collapsed or not.

    Declaration
    public bool IsSplitterCollapsed(int index)
    Parameters
    Type Name Description
    int index

    The index of the splitter.

    Returns
    Type Description
    bool

    True if the splitter is collapsed, false otherwise.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if the index is out of range.

    See Also
    Pane
    Splitter

    PaneAt(int)

    Get the pane at the given index.

    Declaration
    public Pane PaneAt(int index)
    Parameters
    Type Name Description
    int index

    The index of the pane.

    Returns
    Type Description
    Pane

    The pane at the given index.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if the index is out of range.

    See Also
    Pane
    Splitter

    RemovePane(Pane)

    Remove the pane at the given index.

    Declaration
    public void RemovePane(Pane pane)
    Parameters
    Type Name Description
    Pane pane

    The pane to remove.

    See Also
    Pane
    Splitter

    RestoreState(State)

    Restore the state of the SplitView.

    Declaration
    public void RestoreState(SplitView.State state)
    Parameters
    Type Name Description
    SplitView.State state

    The state to restore.

    See Also
    Pane
    Splitter

    SaveState()

    Save the state of the SplitView.

    Declaration
    public SplitView.State SaveState()
    Returns
    Type Description
    SplitView.State

    The state of the SplitView.

    See Also
    Pane
    Splitter

    Implements

    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    IAdditionalDataHolder

    Extension Methods

    VisualElementExtensions.FindNavController(VisualElement)
    RegisterUpdateCallbackExtensions.RegisterUpdateCallback(VisualElement, EventCallback<UpdateEvent>)
    RegisterUpdateCallbackExtensions.UnregisterUpdateCallback(VisualElement, EventCallback<UpdateEvent>)
    VisualElementExtensions.EnableDynamicTransform(VisualElement, bool)
    VisualElementExtensions.EnablePicking(VisualElement, bool)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContextProvider<T>(VisualElement, string)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement, string)
    VisualElementExtensions.GetExclusiveRootElement(VisualElement)
    VisualElementExtensions.GetLastAncestorOfType<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement, string)
    VisualElementExtensions.GetTooltipContent(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.HasAncestorsOfType<T>(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement, string)
    VisualElementExtensions.IsInvisible(VisualElement)
    VisualElementExtensions.IsOnScreen(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, string, T)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, string, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, OptionalEnum<PopoverPlacement>)
    VisualElementExtensions.SetTooltipContent(VisualElement, VisualElementExtensions.TooltipContentCallback)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, string, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)

    See Also

    Pane
    Splitter
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)