蛇形抖动

//输入框为空的时候的蛇形抖动效果(查看APIDemo学习源码)


Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);

et_number.startAnimation(shake);


shake.xml:


<?xml version="1.0" encoding="utf-8"?>


<translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="0" android:toXDelta="10" android:duration="1000" android:interpolator="@anim/cycle_7" />



cycle7.xml:


<?xml version="1.0" encoding="utf-8"?>

<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" />

你可能感兴趣的:(android)