다음을 통해 공유


ListView.ensureVisible method

Makes the item at the specified index visible. If necessary, the ListView will scroll to the item.

Syntax

listView.ensureVisible(value);

Parameters

  • value
    Type: Number

    The index of the item to scroll into view.

Return value

This method does not return a value.

Remarks

When the ListView control's loadingBehavior is set to "incremental", ensureVisible might not work for those items that the ListView hasn't loaded yet. You can force the ListView to load more items by calling loadMorePages. The ensureVisible method always works when the loadingBehavior is "randomaccess".

Calling ensureVisible when the ListView is hidden has no effect.

Requirements

Minimum WinJS version

WinJS 3.0

Namespace

WinJS.UI

See also

ListView