Android - ImageView图形不断旋转的动画
2015-10-10 09:47
489 查看
1. res下建立一个动画文件夹anim
2. anim文件夹下面建立名称为:rotaterepeat动画xml文件
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<rotate
android:duration="1000"
android:fromDegrees="0"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="-1"
android:toDegrees="360" />
</set>
3. Activity文件下
ImageView mAnimationView = (ImageView) findViewById(R.id.animation);
mAnimation = AnimationUtils.loadAnimation(this, R.anim.rotaterepeat);
mAnimationView.startAnimation(mAnimation);
2. anim文件夹下面建立名称为:rotaterepeat动画xml文件
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<rotate
android:duration="1000"
android:fromDegrees="0"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="-1"
android:toDegrees="360" />
</set>
3. Activity文件下
ImageView mAnimationView = (ImageView) findViewById(R.id.animation);
mAnimation = AnimationUtils.loadAnimation(this, R.anim.rotaterepeat);
mAnimationView.startAnimation(mAnimation);
相关文章推荐
- java和android中遇到的英语单词
- Android - 应用程序的组成部分介绍
- Android - 应用程序Manifest文件简介
- android ndk 构建简介
- Ubuntu 安装AndroidStudio过程详解
- Android 众多的布局属性详解
- Android性能优化小集二
- android ndk 内容
- 让低版本的 Android 项目显示出 Material 风格的点击效果
- Android实现推送方式解决方案
- Android:录像
- android 线程池
- 安卓中通知(Notification)的基本使用方法
- Android TextView 属性XML详解
- Android用JavaMail发送邮件
- Android2.2 Socket关闭Bug的解决方…
- Android开发之中文语音朗读
- Android 中 Fragment的使用大全
- android:inputType常用取值
- android drawable