我试图找出如何我可以做一个类似的布局,在谷歌,加上时间线视图。 有动画,而滚动的时间表,我真的很喜欢它。 任何想法如何做到这一点?
I'm trying to figure out how I could make a similar layout as in Google plus timeline view. There's an animation while scrolling in timeline and I really like it. Any idea how to do that?
您需要设置一个TranslateAnimation的观点,这会做的伎俩给你。
You need to set a TranslateAnimation to the view and that would do the trick for you.
TranslateAnimation translateAnim = new TranslateAnimation(200, 0, 0, 0 );
//Use (0, 0, 200, 0 ) if you would like to animate this in a mobile device rather than a tab
listView.clearAnimation();
translateAnim.setDuration(500);
translateAnim.setFillBefore(true);
listView.startAnimation(translateAnim);
希望这有助于:)
Hope this helps :)