ListView
Creates a ListView with all default properties. The itemsSource must all be set for the ListView to function properly.
Read time 1 minuteLast updated 7 days ago
Definition
- Type: Constructor
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
ListView()
Creates a ListView with all default properties. The itemsSource must all be set for the ListView to function properly.
public ListView()
ListView(IList, float, Func<VisualElement>, Action<VisualElement, int>)
Constructs a ListView, with all important properties provided.
public ListView(IList itemsSource, float itemHeight = -1, Func<VisualElement> makeItem = null, Action<VisualElement, int> bindItem = null)
Parameters
The list of items to use as a data source.
The height of each item, in pixels.
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.