Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScrollTo(0,250) with animation Android ScrollView

Tags:

android

When i scrollTo(0,250) i want to include an animation with the scrollaction. i did this code but it is not scrolling according to the animation. scrollMe is the scrolling widget id.

ObjectAnimator anim = ObjectAnimator.ofInt(scrollMe, "translationY",
                        250, 0);
                anim.setDuration(800);
                anim.start();
                scrollMe.scrollTo(0, 250);
like image 354
Dimitri Avatar asked Jan 06 '14 06:01

Dimitri


1 Answers

ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "scrollY", 0, 250).setDuration(duration);
objectAnimator.start();
like image 72
venciallee Avatar answered Oct 07 '22 20:10

venciallee