google plus scrolling technique in android

一曲冷凌霜 提交于 2019-12-13 05:36:20

问题


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 ?


回答1:


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

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);

Hope this helps :)



来源:https://stackoverflow.com/questions/14369901/google-plus-scrolling-technique-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!