1:在acti里调用代码

 Animation shakeAnim = AnimationUtils.loadAnimation(mContext, R.anim.shake_y);
    passWd.startAnimation(shakeAnim);

 

2:在anim目录下的shake_y.xml

 

<?xml version="1.0" encoding="utf-8"?> <translate xmlns:andro >

</translate>

 

3在anim下的cycle.xml文件:

cycles值用来控制摆动的幅度

<?xml version="1.0" encoding="utf-8"?>
<cycleInterpolator xmlns:andro />

 

相关文章:

  • 2021-10-18
  • 2021-05-04
  • 2022-01-10
  • 2022-12-23
  • 2021-07-23
猜你喜欢
  • 2021-11-07
  • 2022-12-23
  • 2021-12-28
  • 2021-10-09
相关资源
相似解决方案