Android的Tween Animation动画介绍
来源:互联网 发布:仿真实验室软件 编辑:程序博客网 时间:2024/04/28 13:47
资源文件:res/anim/filename.xml
一、透明度动画 从看得见到看不见,时间是5秒
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<alpha android:fromAlpha="1.0"
android:toAlpha="0"
android:duration="5000"/>
</set>
代码:
Animation animation = AnimationUtils.loadAnimation(this, R.anim.alpha);
animation.setFillAfter(true); //保持在移动后的位置
imageView.startAnimation(animation);
二、移动动画:用法1、X, Y移动固定像素。
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:fromXDelta="0"
android:fromYDelta="0"
android:toXDelta="100"
android:toYDelta="50"
android:duration="5000"
/>
</set>
用法2、用于切换页面的。从右向左
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate android:fromXDelta="0"
android:toXDelta="-100%p"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="5000"/>
</set>
三、缩放动画
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="5.0"
android:toYScale="5.0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="5000"
/>
</set>
四、旋转动画
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<rotate
android:fromDegrees="0"
android:toDegrees="180"
android:pivotX="50%"
android:pivotY="50%"
android:duration="5000"
/>
</set>
- Android的Tween Animation动画介绍
- Android动画介绍-Tween Animation
- android-animation Tween动画
- Android Animation Tween动画效果的使用
- Android Animation Tween动画效果的使用
- 【UX】Android动画 - Tween Animation
- Android动画之Tween Animation
- Android动画之Tween Animation
- Android动画之Tween Animation
- Android动画之Tween Animation
- android 动画-Tween Animation(二) 动画的简单使用
- Tween Animation——补间动画的简单介绍
- android 动画 Tween animation Frame animation
- Animation---详解Android动画之Tween Animation
- Android动画之Tween Animation变化动画
- Android Animation 动画(一)--Tween动画
- Android 动画--补间动画(Tween Animation)
- Android 动画之二 View Animation —— 补间(Tween)动画与Interpolator的介绍
- C#十六进制颜色与Color对象的互相转换
- Become a iOS coder iOS入门文档
- 从程序员到技术总监,分享10年开发经验
- hibernate操作java.util.Date和java.sql.Date
- 接口类与抽象函数类的区别
- Android的Tween Animation动画介绍
- java的文件操作
- 邮件发送
- 如何查看linux和windows系统是32为还是64位?
- java的IO处理
- url传递中文,和重定位
- 各排序算法效率图
- C++ 类访问控制public/private/protected探讨
- 设计模式入门学习 观察者模式