ListView.JumpToIndexPage
JumpToIndexPage(int)
Jumps the ListView to the virtualized page of the item at the given index
Remarks
If UIBlock.gameObject.activeInHierarchy == false
, this call won't do anything.
Declaration
public float JumpToIndexPage(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index into the data source, set via SetDataSource<T>(IList<T>), of the object to bind into view and jump to |
Returns
Type | Description |
---|---|
float | The signed distance the list must be scrolled to make the jumped-to item maximally visible within the viewport. |
Examples
// Bind element at index 100 and its surrounding elements to the ListView.
float distanceOutOfView = listView.JumpToIndexPage(100);
// move the element at index 100 into view
listView.Scroll(distanceOutOfView);
Exceptions
Type | Condition |
---|---|
System.IndexOutOfRangeException | if |
System.InvalidOperationException | if |
See Also
JumpToIndex(System.Int32)