共用方式為


ListView.ScrollTo Method

Definition

Overloads

ScrollTo(Object, Object, ScrollToPosition, Boolean)

Scrolls the ListView to the item in the group

ScrollTo(Object, ScrollToPosition, Boolean)

Scrolls the ListView to the item.

ScrollTo(Object, Object, ScrollToPosition, Boolean)

Scrolls the ListView to the item in the group

public void ScrollTo (object item, object group, Xamarin.Forms.ScrollToPosition position, bool animated);
member this.ScrollTo : obj * obj * Xamarin.Forms.ScrollToPosition * bool -> unit

Parameters

item
System.Object

The item from your ItemsSource to scroll to.

group
System.Object

The group from your ItemsSource to scroll to.

position
ScrollToPosition

How the item should be positioned on screen.

animated
System.Boolean

Whether or not the scroll should be animated.

Exceptions

System.ArgumentException

position contains an invalid value for ScrollToPosition.

System.InvalidOperationException

IsGroupingEnabled is false.

Remarks

A linear search is done for the item, so if the same reference appears multiple times in the group, the first item will be scrolled to. The same item in a different group will be ignored.

Applies to

ScrollTo(Object, ScrollToPosition, Boolean)

Scrolls the ListView to the item.

public void ScrollTo (object item, Xamarin.Forms.ScrollToPosition position, bool animated);
member this.ScrollTo : obj * Xamarin.Forms.ScrollToPosition * bool -> unit

Parameters

item
System.Object

The item from your ItemsSource to scroll to.

position
ScrollToPosition

How the item should be positioned on screen.

animated
System.Boolean

Whether or not the scroll should be animated.

Exceptions

System.ArgumentException

position contains an invalid value for ScrollToPosition.

Remarks

A linear search is done for the item, so if the same reference appears multiple times in the list, the first item will be scrolled to. This includes if grouping is enabled.

Applies to