Android开发中cycleInterpolator 循环加速器

来源:互联网 发布:ubuntu和centos 编辑:程序博客网 时间:2024/05/02 19:31

在res--->anim--->cycle.xml

如果要让动画连续执行多次,可以使用cycleInterpolator加速器

设置方法:
<?xml version=”1.0″ encoding=”utf-8″?>
<cycleInterpolator xmlns:android=”http://schemas.android.com/apk/res/android” android:cycles=”7″ />

 

res--->anim--->translate.xml

动画移动效果

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
   android:fromXDelta="0"
   android:toXDelta="10"
   android:duration="1000"
   android:interpolator="@anim/cycle" />

 

刷新动画时:

      Animation shake01 = AnimationUtils.loadAnimation(this,R.anim.shake);
      btnRefresh.startAnimation(shake01);
      gameView.refreshChange();

原创粉丝点击