安卓:HorizontalScrollView smoothScroll动画时间 [英] Android: HorizontalScrollView smoothScroll animation time
本文介绍了安卓:HorizontalScrollView smoothScroll动画时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一种情况,我使用与图像的水平滚动视图并使用按钮来平滑滚动到不同的图像位置。现在,它的工作原理好吧,我只是想知道是否有人知道反正减缓平滑滚动的方法,即具有较长annimation时间?作为目前捕捉迅速发生pretty的。
I have a situation in that I am using a horizontal scroll view with images and using buttons to smooth scroll to the different image locations. Now it works okay I was just wondering if anyone knew of anyway to slow down the smooth scroll method, i.e. having a longer annimation time? As currently the snapping happens pretty quickly.
也许通过smoothscroll的重写,我试图寻找这/例子,但没有运气。
Perhaps through an override of the smoothscroll, I have tried to search for this/examples but to no luck.
因此,任何想法?
谢谢
硅
推荐答案
怎么样:
ObjectAnimator animator=ObjectAnimator.ofInt(yourHorizontalScrollView, "scrollX",targetXScroll );
animator.setDuration(800);
animator.start();
这篇关于安卓:HorizontalScrollView smoothScroll动画时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文