android 无限旋转动画,android ——不停旋转动画
生活随笔
收集整理的這篇文章主要介紹了
android 无限旋转动画,android ——不停旋转动画
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
xml文件
```
android:fromDegrees="359"
android:toDegrees="0"
android:duration="1000"
android:repeatCount="-1"
android:pivotX="50%"
android:pivotY="50%"/>
代碼
/開始旋轉(zhuǎn)/
public voidstartRotateAnimation(View view, intsetid) {
Animation rotateAnim = AnimationUtils.loadAnimation(this,setid);
LinearInterpolator lin =newLinearInterpolator();
rotateAnim.setInterpolator(lin);
if(rotateAnim !=null) {
view.startAnimation(rotateAnim);
}
}
/*
停止旋轉(zhuǎn)
*/
public voidstopRotateAnimation(View v) {
v.clearAnimation();
}
```
總結(jié)
以上是生活随笔為你收集整理的android 无限旋转动画,android ——不停旋转动画的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 网络语言不c,哪些网络用语不文明?
- 下一篇: 谷歌发布最新版安卓Android,谷歌正