如何在 Xamarin.Forms 中自动滚动

How to scroll automatically in Xamarin.Forms

在 Xamarin.Android 中,我可以在图像末尾自动滚动:

scrollView.Post(() => scrollView.FullScroll(FocusSearchDirection.Right));

如何在 Xamarin.Forms 中执行相同的操作?

ScrollView 有 2 种方法可用于完成此操作:

public Task ScrollToAsync (double x, double y, bool animated)
public Task ScrollToAsync (Element element, ScrollToPosition position, bool animated)

https://developer.xamarin.com/api/type/Xamarin.Forms.ScrollView/#Public_Methods

在 ListView 中,您可以使用 ScrollTo , in a ScrollView you can use ScrollToAsync for position or ScrollToAsync for a element