上一篇:http://www.bkjia.com/kf/201208/149367.html
本例為GridView的Cell提供了波浪一波一波向前推進的效果.
<gridLayoutAnimation xmlns:android=”http://schemas.android.com/apk/res/android”
android:rowDelay=”75%”
android:columnDelay=”0%”
android:directionPriority=”none”
android:animation=”@anim/wave_scale” />
主要是通過wave_scale 實現的:
<set xmlns:android=”http://schemas.android.com/apk/res/android”
android:interpolator=”@android:anim/accelerate_interpolator”>
<alpha
android:fromAlpha=”0.0″
android:toAlpha=”1.0″
android:duration=”100″ />
< scale
android:fromXScale=”0.5″ android:toXScale=”1.5″
android:fromYScale=”0.5″ android:toYScale=”1.5″
android:pivotX=”50%” android:pivotY=”50%”
android:duration=”200″ />
< scale
android:fromXScale=”1.5″ android:toXScale=”1.0″
android:fromYScale=”1.5″ android:toYScale=”1.0″
android:pivotX=”50%” android:pivotY=”50%”
android:startOffset=”200″
android:duration=”100″ />
< /set>
波浪的效果是先從0.5倍放大到1.5倍,然後再從1.5倍複原到原始大小。 <set> 為其它animation類型<alpha>,<scale>,<translate>和<rotate>或其它<set>的容器。參見Android ApiDemos樣本解析(3): App->Activity->Animation