您的位置:首页 > 移动开发 > Android开发

Android抖动的EditText

2016-01-18 19:11 435 查看
Java代码:启动动画

Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
findViewById(R.id.pw).startAnimation(shake);


anim/shake.xml

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


duration为抖动时间,fromXDelta,toXDelta抖动幅度

anim/cycle_7.xml

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


EditText
<EditText android:id="@+id/pw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: