微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

xml和代码实现Animation

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)); 布局文件

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念
xml文件介绍及使用
xml编程(一)-xml语法
XML文件结构和基本语法
第2章 包装类