本文介绍了谷歌加上Android中的滚动技术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道有没有一种方法可以复制google plus滚动的工作方式.我特别在谈论新项目在屏幕上出现的方式,它被延迟了,我想其中添加了一些动画.任何想法如何做到这一点?

I was wondering is there a way we can replicate how google plus scrolling works.I am specifically talking about the way the new items come up on screen, it is delayed and I guess there is some animation added to it.Any ideas how this is done ?

推荐答案

在自定义"适配器的getView方法中,尝试将以下动画添加到convertView(列表视图项),您应该能够做到这一点.它对我有用

In the getView method of your Custom adapter, try adding the below animation to the convertView(list view item) and you should be able to do this..and its working for me

您需要为视图设置一个TranslateAnimation,这将为您解决问题.

You need to set a TranslateAnimation to the view and that would do the trick for you.

TranslateAnimation translateAnim = new TranslateAnimation(0, 0, 200, 0 );
listView.clearAnimation();
translateAnim.setDuration(500);
translateAnim.setFillBefore(true);
listView.startAnimation(translateAnim);

希望这会有所帮助:)

这篇关于谷歌加上Android中的滚动技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-01 11:18