如何在Xamarin.Forms中自动滚动 [英] How to scroll automatically in Xamarin.Forms
本文介绍了如何在Xamarin.Forms中自动滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Xamarin.Android中,我可以在图片的末尾自动滚动:
In Xamarin.Android I can scroll automatically at the end of my image:
scrollView.Post(() => scrollView.FullScroll(FocusSearchDirection.Right));
如何在Xamarin.Forms中执行相同的操作?
How can I do the same in Xamarin.Forms?
推荐答案
ScrollView
有2种方法可以完成此任务:
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
这篇关于如何在Xamarin.Forms中自动滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文