Android View.startAnimation()动画
1.
android:repeatMode="restart"android:repeatCount="10"?
?
?
注:Delta也可以用%p為單位?
例子:
android:fromXDelta="0"?android:toXDelta="-100%p"?往左邊消失
android:fromXDelta="-100%p"?android:toXDelta="0"?從左邊進
android:fromXDelta="0"?android:toXDelta="100%p"?往右邊消失
android:fromXDelta="100%p"?android:toXDelta="0"?從右邊進
?
?
二、Rotate?定義視圖旋轉角度
視圖的中心位置旋轉360度,時間1秒完成
<set?xmlns:android="http://schemas.android.com/apk/res/android">
<rotate?
????android:fromDegrees="0"
????android:toDegrees="+360"
????android:pivotX="50%"
????android:pivotY="50%"
????android:duration="1000"/>
</set>
三、Scale?定義視圖縮放動畫
<set?xmlns:android="http://schemas.android.com/apk/res/android"??
????????android:interpolator="@android:anim/accelerate_interpolator">??
???<scale?android:fromXScale="0.0"?android:toXScale="1.0"??
?????????android:fromYScale="0.0"?android:toYScale="1.0"??
?????????android:pivotX="50%p"?android:pivotY="50%p"??
?????????android:duration="300"/>??
</set>?
//上面的效果為從中間爆出來的效果,可用于Activity的過度效果
釋:Scale定義如何沿著x軸方向(或y軸方向)改變視圖的大小,視圖大小發生變化時樞軸(pivot)位置是保持不變的?pivotX/pivotY為x/y軸的百分比
四、Alpha?定義視圖的透明痛
<set?xmlns:android="http://schemas.android.com/apk/res/android">
<alpha?
????android:fromAlpha="0.1"
????android:toAlpha="1.0"
????android:duration="3000"/>
</set>
????注:透明度變化范圍從0.0(透明)到1.0(不透明)
?
?
参考:http://blog.csdn.net/wfung_kwok/article/details/7202682