zoukankan      html  css  js  c++  java
  • Android抖动的EditText

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


  • 相关阅读:
    km算法
    HDU 1358
    HDU 3746
    CF 432D
    HDU 4725
    14年百度之星资格赛第四题
    AC自动机
    RMQ
    HDU 4635
    HDU 3667
  • 原文地址:https://www.cnblogs.com/gcczhongduan/p/5140231.html
Copyright © 2011-2022 走看看