zoukankan      html  css  js  c++  java
  • 软工超越日报-android的简单旋转效果实现 5/13

    今天我们来写一个简单的等待动画,使用了专门实现rotateAnimation

    代码如下:

    RotateAnimation rotate  = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    LinearInterpolator lin = new LinearInterpolator();
    rotate.setInterpolator(lin);
    rotate.setDuration(20000);//设置动画持续周期
    rotate.setRepeatCount(-1);//设置重复次数
    rotate.setFillAfter(true);//动画执行完后是否停留在执行完的状态
    rotate.setStartOffset(10);//执行前的等待时间

    ImageView ssp=(ImageView)findViewById(R.id.image_view);
    ssp.setAnimation(rotates);
    ssp.setAnimation(rotates);
    
    

    只需要指定好需要旋转的控件即可——是不是十分简单呢?

  • 相关阅读:
    头文件<stdarg.h>
    头文件<signal.h>
    头文件<setjmp.h>
    头文件<math.h>
    头文件<locale.h>
    头文件<limits.h>
    头文件<ctype.h>
    头文件<assert.h>
    PHP error_reporting
    八大排序算法
  • 原文地址:https://www.cnblogs.com/Sakuraba/p/14910904.html
Copyright © 2011-2022 走看看