How to scroll automatically in Xamarin.Forms

2019-06-08 09:28发布

In Xamarin.Android I can scroll automatically at the end of my image:

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

How can I do the same in Xamarin.Forms?

2条回答
再贱就再见
2楼-- · 2019-06-08 10:14

ScrollView has 2 methods available to accomplish this:

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

查看更多
爷的心禁止访问
3楼-- · 2019-06-08 10:17

In a ListView you can use ScrollTo , in a ScrollView you can use ScrollToAsync for position or ScrollToAsync for a element

查看更多
登录 后发表回答