public class
AnimationSet
extends Animation
java.lang.Object | |
↳ | android.view.animation.Animation |
↳ | android.view.animation.AnimationSet |
一、配置xml檔案
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="500" android:repeatCount="20">
</alpha>
<rotate android:fromDegrees="0.0" android:toDegrees="360.0"
android:repeatCount="20" android:duration="500" android:pivotX="160.0"
android:pivotY="240.0">
</rotate>
</set>
二、開啟動畫
iv_show = (ImageView) findViewById(R.id.iv_show);
final AnimationSet aa = (AnimationSet) AnimationUtils
.loadAnimation(this, R.anim.anim_set);
iv_show.startAnimation(aa);
三、屬性設定
set作為一個集合,将多個動畫放到一起