添加动画资源:custom_cycle.xml xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" /> 添加动画资源:shake.xml xmlns:android="http://schemas.android.com/apk/res/android" android:duration="1000" android:fromXDelta="0" android:interpolator="@anim/custom_cycle" android:toXDelta="10" /> 加载 Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake); findViewById(R.id.xxx).startAnimation(shake); android:duration="20" android:fromDegrees="-10.0" android:toDegrees="10.0" android:pivotX="50.0%" android:pivotY="90.0%" android:repeatCount="10" android:repeatMode="reverse" />