当前位置:操作系统 > 安卓/Android >>

Android ApiDemos示例解析(131):Views->Layout Animation->6. Wave Scale

上一篇:http://www.zzzyk.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

 

 \

补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,