TreeView
Creates a TreeView with all default properties.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Constructor
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
TreeView()
Creates a TreeView with all default properties.
public TreeView()
Remarks
Use BaseTreeView.SetRootItems to add content.
TreeView(Func<VisualElement>, Action<VisualElement, int>)
Creates a TreeView with specified factory methods.
public TreeView(Func<VisualElement> makeItem, Action<VisualElement, int> bindItem)
Parameters
The factory method to call to create a display item. The method should return a VisualElement that can be bound to a data item.
The method to call to bind a data item to a display item. The method receives as parameters the display item to bind, and the index of the data item to bind it to.
Remarks
Use BaseTreeView.SetRootItems to add content.
TreeView(int, Func<VisualElement>, Action<VisualElement, int>)
Creates a TreeView with specified factory methods using the fixed height virtualization method.
public TreeView(int itemHeight, Func<VisualElement> makeItem, Action<VisualElement, int> bindItem)
Parameters
The item height to use in FixedHeight virtualization mode.
The factory method to call to create a display item. The method should return a VisualElement that can be bound to a data item.
The method to call to bind a data item to a display item. The method receives as parameters the display item to bind, and the index of the data item to bind it to.
Remarks
Use BaseTreeView.SetRootItems to add content.