edison_cool911 发表于 2013-2-3 10:31:22

文本抖动效果

几句代码如下:
Animation animation = AnimationUtils.loadAnimation(this, R.anim.shake);EditText editText = (EditText) findViewById(R.id.edittext); editText.startAnimation(animation);

shake.xml:
里面面的fromXDelta,toXDelta是表示x轴方向的移动距离
<translate xmlns:android="http://schemas.android.com/apk/res/android"android:fromXDelta="0" android:toXDelta="30" android:duration="1000"android:interpolator="@anim/cycle_interpolator" />

cycleInterpolator.xml文件:
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"android:cycles="3" />
页: [1]
查看完整版本: 文本抖动效果