Android抖动的输入框
抖动的输入框
Java代码:启动动画
[java]
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
findViewById(R.id.pw).startAnimation(shake);
anim/shake.xml
[html]
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="5000"
android:fromXDelta="0"
android:interpolator="@anim/cycle_7"
android:toXDelta="10" />
duration为抖动时间,fromXDelta,toXDelta抖动幅度
anim/cycle_7.xml
[html]
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:cycles="50" />
main.xml
[html]
<EditText android:id="@+id/pw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="50dip"
android:clickable="true"
android:singleLine="true"
android:password="true"
/>
作者:Android_Xiaoqi
补充:移动开发 , Android ,