FREE TRIAL

|

☀
☾

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.

Calling Nova.ListView.JumpToIndexPage(int) only guarantees to bind the element at the provided index to
the ListView, but it might be slightly out of view without a subsequent call to Nova.ListView.Scroll(float).

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 index < 0 || index >= DataSourceItemCount

System.InvalidOperationException

if UIBlock.AutoLayout.Axis == Axis.None

See Also
JumpToIndex(System.Int32)
ScrollToIndex(Int32, Boolean)
☀
☾
In This Article
Legal EmailContact Github
Copyright © 2022 Supernova Technologies, LLC