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);
    
    

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

  • 相关阅读:
    数据分析(三)
    数据分析(二)
    数据分析(一)
    sql server 脚本创建数据库和表
    各种距离分析
    DataTable数据导出CSV文件
    WPF中Grid布局
    111
    123
    SVN的安装与使用
  • 原文地址:https://www.cnblogs.com/Sakuraba/p/14910904.html
Copyright © 2011-2022 走看看