android Animation 动画效果介绍 续
来源:互联网 发布:弯沉计算软件 编辑:程序博客网 时间:2024/06/05 09:31
Android动画解析--JavaCode
AlphaAnimation
① AlphaAnimation类对象定义
① AlphaAnimation类对象定义
private AlphaAnimation myAnimation_Alpha;
② AlphaAnimation类对象构造
AlphaAnimation(float fromAlpha, float toAlpha) //第一个参数fromAlpha为 动画开始时候透明度//第二个参数toAlpha为 动画结束时候透明度myAnimation_Alpha=new AlphaAnimation(0.1f, 1.0f);//说明: // 0.0表示完全透明// 1.0表示完全不透明
③ 设置动画持续时间
myAnimation_Alpha.setDuration(5000);//设置时间持续时间为 5000毫秒
ScaleAnimation
① ScaleAnimation类对象定义
private AlphaAnimation myAnimation_Alpha;
② ScaleAnimation类对象构造
ScaleAnimation(float fromX, float toX, float fromY, float toY,int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) //第一个参数fromX为动画起始时 X坐标上的伸缩尺寸 //第二个参数toX为动画结束时 X坐标上的伸缩尺寸 //第三个参数fromY为动画起始时Y坐标上的伸缩尺寸 //第四个参数toY为动画结束时Y坐标上的伸缩尺寸 /*说明:以上四种属性值 0.0表示收缩到没有 1.0表示正常无伸缩 值小于1.0表示收缩 值大于1.0表示放大*///第五个参数pivotXType为动画在X轴相对于物件位置类型 //第六个参数pivotXValue为动画相对于物件的X坐标的开始位置//第七个参数pivotXType为动画在Y轴相对于物件位置类型 //第八个参数pivotYValue为动画相对于物件的Y坐标的开始位置myAnimation_Scale =new ScaleAnimation(0.0f, 1.4f, 0.0f, 1.4f,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);③ 设置动画持续时间
myAnimation_Scale.setDuration(700);//设置时间持续时间为 700毫秒
TranslateAnimation
① TranslateAnimation类对象定义
private AlphaAnimation myAnimation_Alpha;
② TranslateAnimation类对象构造
TranslateAnimation(float fromXDelta, float toXDelta,float fromYDelta, float toYDelta) //第一个参数fromXDelta为动画起始时 X坐标上的移动位置 //第二个参数toXDelta为动画结束时 X坐标上的移动位置 //第三个参数fromYDelta为动画起始时Y坐标上的移动位置 //第四个参数toYDelta为动画结束时Y坐标上的移动位置
③ 设置动画持续时间
myAnimation_Translate.setDuration(2000);//设置时间持续时间为 2000毫秒
RotateAnimation
① RotateAnimation类对象定义
private AlphaAnimation myAnimation_Alpha;
② RotateAnimation类对象构造
RotateAnimation(float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)//第一个参数fromDegrees为动画起始时的旋转角度 //第二个参数toDegrees为动画旋转到的角度 //第三个参数pivotXType为动画在X轴相对于物件位置类型 //第四个参数pivotXValue为动画相对于物件的X坐标的开始位置//第五个参数pivotXType为动画在Y轴相对于物件位置类型 //第六个参数pivotYValue为动画相对于物件的Y坐标的开始位置myAnimation_Rotate=new RotateAnimation(0.0f, +350.0f,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF, 0.5f);
③ 设置动画持续时间
myAnimation_Rotate.setDuration(3000);//设置时间持续时间为 3000毫秒
如何使用Java代码中的动画效果
使用从View父类继承过来的方法startAnimation()来为View或是子类View等等添加一个动画效果
public void startAnimation (Animation animation)
- android Animation 动画效果介绍 续
- android Animation 动画效果介绍 续
- android Animation 动画效果介绍 续 .
- android Animation 动画效果介绍
- android Animation 动画效果介绍
- android Animation 动画效果介绍
- android Animation 动画效果介绍
- android Animation 动画效果介绍
- Android Animation 动画效果介绍
- android Animation 动画效果介绍
- android Animation 动画效果介绍
- android Animation 动画效果介绍
- android动画介绍--Animation 实现loading动画效果
- android动画介绍--Animation实现loading动画效果
- Android 动画效果 --Animation
- Android 动画效果 --Animation
- Android 动画效果 --Animation
- Android Animation动画效果
- HTML的input中type属性的属性值包括哪些
- 河南省第五届ACM程序设计竞赛题解
- MyEclipse清除所有断点的方法
- LVM简单介绍——A simple introduction to working with LVM
- XWriterLib文本编辑器中间件软件技术白皮书
- android Animation 动画效果介绍 续
- vi基本精简命令
- mathtype格式调整问题
- 编译Ubuntu10.04的第一个内核模块
- 端口
- Java Servlet技术 (总结)
- 分析http的一些简单实例源码
- tizen sdk启动报错no java virtual machine was found after searching问题处理
- 用ccs5调试beaglebone