码迷,mamicode.com
首页 > 移动开发 > 详细

Android抖动的EditText

时间:2016-01-18 20:43:09      阅读:296      评论:0      收藏:0      [点我收藏+]

标签:

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"  
    />  


Android抖动的EditText

标签:

原文地址:http://www.cnblogs.com/gcczhongduan/p/5140231.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!