使用动画Android ScrollView ScrollTo(0,250)

Dim*_*tri 4 android

当我滚动(0,250)我想要包含一个带滚动的动画.我做了这个代码,但根据动画不滚动.scrollMe是滚动小部件ID.

ObjectAnimator anim = ObjectAnimator.ofInt(scrollMe, "translationY",
                        250, 0);
                anim.setDuration(800);
                anim.start();
                scrollMe.scrollTo(0, 250);
Run Code Online (Sandbox Code Playgroud)

ven*_*lee 7

ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "scrollY", 0, 250).setDuration(duration);
objectAnimator.start();
Run Code Online (Sandbox Code Playgroud)