我有一个应用程序在gridview中显示的项目列表。我希望能够创建一个动画效果,就像在google current中使用的那样,当一个新项目出现在屏幕上时,它会慢慢移动到它固定的地方。
目前我一直在GridView元素上玩android:layoutAnimation,但这似乎没有给我想要的那种控制。有人有什么建议吗,关于这可能需要做什么?
我正在制作相同的动画。基本上我创建了一个自定义布局,它扩展了LinearLayout并实现了onGlobalLayoutListener。在onGlobalLayout()中,我循环遍历所有子节点,并对每个子节点使用. startanimation。对于动画,使用如下内容:
slide_up.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator" >
<translate
android:duration="800"
android:fromYDelta="100%p"
android:toYDelta="0" />
<alpha
android:duration="800"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
<rotate
android:duration="800"
android:fromDegrees="25"
android:pivotX="0"
android:pivotY="0"
android:toDegrees="0" />
</set>
编辑:更多信息请访问:http://shardulprabhu.blogspot.de/2012/09/google-now-cards-layout.html