ListView.ScrollTo Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ScrollTo(Object, Object, ScrollToPosition, Boolean) |
Scrolls the ListView to the |
ScrollTo(Object, ScrollToPosition, Boolean) |
Scrolls the ListView to the |
ScrollTo(Object, Object, ScrollToPosition, Boolean)
Scrolls the ListView to the item
in the group
public:
void ScrollTo(System::Object ^ item, System::Object ^ group, Microsoft::Maui::Controls::ScrollToPosition position, bool animated);
public void ScrollTo (object item, object group, Microsoft.Maui.Controls.ScrollToPosition position, bool animated);
member this.ScrollTo : obj * obj * Microsoft.Maui.Controls.ScrollToPosition * bool -> unit
Public Sub ScrollTo (item As Object, group As Object, position As ScrollToPosition, animated As Boolean)
Parameters
- item
- Object
The item from your ItemsSource to scroll to.
- group
- Object
The group from your ItemsSource to scroll to.
- position
- ScrollToPosition
How the item should be positioned on screen.
- animated
- Boolean
Whether or not the scroll should be animated.
Exceptions
position
contains an invalid value for ScrollToPosition.
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(System::Object ^ item, Microsoft::Maui::Controls::ScrollToPosition position, bool animated);
public void ScrollTo (object item, Microsoft.Maui.Controls.ScrollToPosition position, bool animated);
member this.ScrollTo : obj * Microsoft.Maui.Controls.ScrollToPosition * bool -> unit
Public Sub ScrollTo (item As Object, position As ScrollToPosition, animated As Boolean)
Parameters
- item
- Object
The item from your ItemsSource to scroll to.
- position
- ScrollToPosition
How the item should be positioned on screen.
- animated
- Boolean
Whether or not the scroll should be animated.
Exceptions
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
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應