xml文件
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="50"
android:fromDegrees="-5"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:toDegrees="5" />
在代码中使用
Animation animation = AnimationUtils.loadAnimation(MainActivity.this, R.anim.anim_shack); ball.startAnimation(animation);
网友评论