左右抖动动画

xml文件


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);

你可能感兴趣的:(左右抖动动画)