自动滚动Android ViewGroup从上到下,从下到上

时间:2016-10-05 06:08:48

标签: android android-viewgroup

在这里,我尝试自动从上到下滚动GridView,当它到达最后一个项目时,使用smoothScrollToPosition将其从底部滚动回顶部,但速度非常快。代码是:

  homeGridView.postDelayed(new Runnable() {
        public void run() {
            //       ObjectAnimator.ofInt(homeGridView, "scrollY",  homeGridView.getCount()-1).setDuration(1000).start();
            homeGridView.smoothScrollToPosition(homeGridView.getCount() - 1);
            homeGridView.postDelayed(new Runnable() {
                public void run() {
                    // ObjectAnimator.ofInt(homeGridView, "scrollY",  0).setDuration(1000).start();
                    homeGridView.smoothScrollToPosition(0);
                }
            }, 1000);
        }
    }, 1000);

现在我只想知道如何降低此卷轴的速度或更好的效果。

0 个答案:

没有答案
相关问题