Reputation: 55
I use Xamarin, I want to scroll programmatically my ScrollView to custom the position with animation. I try this code
public async Task Start(){
await ScrollView.ScrollToAsync(0, y, true);
}
From developer.xamarin.com third parameter is animation public Task ScrollToAsync (Element element, ScrollToPosition position, Boolean animated)
And it called from button.Clicked += async (sender, e) => await Start();
It is beautiful work on the real device with Android with animation, but on UWP Windows 10 Mobile animation doesn't show.
Whether is it possible to make animation programming scroll to the position on the UWP? I would like as much as possible simple way. Thanks!
Upvotes: 0
Views: 3594
Reputation: 55
use Task.Delay
, and animation will be work
public async Task Start(){
await Task.Delay(1);
await ScrollView.ScrollToAsync(0, y, true);
}
Upvotes: 1