xml和代码实现Animation
2016-03-31 10:47
323 查看
1.Tweened Animation 渐变动画
该类提供了 旋转,移动,淡入淡出,缩放
2.Frame-by-Frame Animation
和放电影一样 通过一系列的图片 按照我们制定的动作 显示出来
Tweened Animation:
1.Alpha:淡入淡出效果
2.Scale:缩放效果
3.Rotate:旋转效果
4.Translate:移动效果
Tweened Animation 渐变动画
AlphaAmination:淡入淡出
Public Constructors:
AlphaAnimation(Context context, AttributeSet attrs)
Constructor used when an AlphaAnimation is loaded from a resource.
AlphaAnimation(float fromAlpha, float toAlpha)
Constructor to use when building an AlphaAnimation from code
Public Methods:
willChangeBounds() :返回值boolean
Indicates whether or not this animation will affect the bounds of the animated view.
willChangeTransformationMatrix() :返回值 boolean
Indicates whether or not this animation will affect the transformation matrix.
Protected Methods
applyTransformation(float interpolatedTime, Transformation t) 无返回值
Changes the alpha property of the supplied Transformation
使用
代码方式使用该效果:
// AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
// alphaAnimation.setDuration(1000);
// arg0.startAnimation(alphaAnimation);
布局形式使用该效果:
arg0.startAnimation(AnimationUtils.loadAnimation(MainActivity.this,R.anim.alpha));
布局文件:
该类提供了 旋转,移动,淡入淡出,缩放
2.Frame-by-Frame Animation
和放电影一样 通过一系列的图片 按照我们制定的动作 显示出来
Tweened Animation:
1.Alpha:淡入淡出效果
2.Scale:缩放效果
3.Rotate:旋转效果
4.Translate:移动效果
Tweened Animation 渐变动画
AlphaAmination:淡入淡出
Public Constructors:
AlphaAnimation(Context context, AttributeSet attrs)
Constructor used when an AlphaAnimation is loaded from a resource.
AlphaAnimation(float fromAlpha, float toAlpha)
Constructor to use when building an AlphaAnimation from code
Public Methods:
willChangeBounds() :返回值boolean
Indicates whether or not this animation will affect the bounds of the animated view.
willChangeTransformationMatrix() :返回值 boolean
Indicates whether or not this animation will affect the transformation matrix.
Protected Methods
applyTransformation(float interpolatedTime, Transformation t) 无返回值
Changes the alpha property of the supplied Transformation
使用
代码方式使用该效果:
// AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
// alphaAnimation.setDuration(1000);
// arg0.startAnimation(alphaAnimation);
布局形式使用该效果:
arg0.startAnimation(AnimationUtils.loadAnimation(MainActivity.this,R.anim.alpha));
布局文件:
相关文章推荐
- java23中设计模式——结构模式——Bridge(桥接) 3ff0
- c++作业2
- java 通配符解惑
- C# 关键字var
- VS批量删注释,代码保护第一步
- Asp调用存储过程,command.CreateParameter 参数值的类型说明
- C# 格式化字符串
- char*,const char*和string的相互转换(转载)
- 从GitHub上下载单个文件(夹)
- matlab程序编程
- Go语言学习九:Map(集合)、递归函数、类型转换
- yii2-GridView在开发中常用的功能及技巧
- yii使用网页
- Github push掉坑纪录
- C# decimal类型(值类型、非基本类型)
- php的查询数据
- vc2008对话框中mschart控件应用
- C语言排序法(选择排序法/冒泡排序法)
- c++11 学习及测试(emplace_back实现方式 数学分布 正则表达式)
- java多线程总结