Kirill
Kirill

Reputation: 1472

How to scroll automatically in Xamarin.Forms

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?

Upvotes: 1

Views: 6208

Answers (2)

Rui Marinho
Rui Marinho

Reputation: 1712

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

Upvotes: 3

pnavk
pnavk

Reputation: 4630

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

Upvotes: 4

Related Questions