开发者

HorizontalScrollView, auto-scroll to end with animation

I have a horizontalScrollView and I need to make an auto-scroll to end with animation when I load the view. I have implemented this method to do it:

final HorizontalScrollView strip = (HorizontalScrollView) contentView.
    findViewById(R.id.horizontalScrollView1);

strip.postDelayed(new Runnable() {

    public void run() {
        strip.fullScroll(HorizontalScrollView.FOCUS_RIGHT);
    }
}, 1000L);

It works开发者_StackOverflow fine, but, the main problem is the animation of the scrolling is too fast and I need to implement a slower scrolling. Have you any idea?


This is a demo project I created for one of my projects. Its a scroller the scroll automatically and continously. It was made to show a credits screen by continously scrolling through a list of images. This might help you or give you some idea.

https://github.com/blessenm/SlideshowDemo


Try this:

ObjectAnimator animator=ObjectAnimator.ofInt(buttonHolderScrollView, "scrollX",targetXScroll );
animator.setStartDelay(100);
animator.setDuration(100);
animator.start();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜