旋轉180度後停止
RotateAnimation rotate;
rotate =new RotateAnimation(0f,180f,Animation.RELATIVE_TO_SELF,
0.5f,Animation.RELATIVE_TO_SELF,0.5f);
rotate.setDuration(1000);
rotate.setFillAfter(true);
image.startAnimation(rotate);
持續旋轉,不停止
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >
<rotate
android:duration="2000"
android:fromDegrees="0"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="-1"
android:repeatMode="restart"
android:startOffset="-1"
android:toDegrees="+360" />
</set>
rotate = AnimationUtils.loadAnimation(MychoiceActivity.this, R.anim.dialog_loading_animation);
image.startAnimation(rotate);