7

我有一个horizo​​ntalScrollView,我需要在加载视图时自动滚动以结束动画。我已经实现了这个方法来做到这一点:

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

strip.postDelayed(new Runnable() {

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

它工作正常,但主要问题是滚动动画太快,我需要实现较慢的滚动。你有什么想法吗?

4

2 回答 2

6

这是我为我的一个项目创建的演示项目。它是一个自动和连续滚动的滚动条。它是通过不断滚动图像列表来显示信用屏幕的。这可能会对您有所帮助或给您一些想法。

https://github.com/blessenm/SlideshowDemo

于 2011-09-19T12:10:28.683 回答
5

试试这个:

ObjectAnimator animator=ObjectAnimator.ofInt(buttonHolderScrollView, "scrollX",targetXScroll );
animator.setStartDelay(100);
animator.setDuration(100);
animator.start();
于 2013-07-22T12:42:10.763 回答