这里是详细的android方面的笔记资料,按照序号走就都可以下载到,全部是本人测试通过的,有注释,有解释!
Animation.RELATIVE_TO_SELF[相对于自身]
TranslateAnimation ta = new TranslateAnimation(Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 100, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 100);
ta.setRepeatMode(0); //重复次数
ta.setDuration(5000); //时长
iv.startAnimation(ta);
}
//---------------------------------------------------------------------
/**
* 透明度
*/
private void alpha(){
Animation aa = AnimationUtils.loadAnimation(this, R.anim.alpha);
iv.startAnimation(aa);
}
/**
* 编程式透明度
*/
private void codeAlpha(){
AlphaAnimation aa = new AlphaAnimation(0.1f, 1);
aa.setDuration(5000); //持续时间
iv.startAnimation(aa);
}
//---------------------------------------------------------------------
/**
* 比例缩放效果
*/
private void scale() {
//加载动画xml文件 ,生成动画指令
Animation animation = AnimationUtils.loadAnimation(this, R.anim.scale);
//开始执行动画
iv.startAnimation(animation);
}
/**
* 编程式 比例缩放
*/
private void codeScale(){
//fromX, toX, fromY, toY, pivotXType, pivotXValue, pivotYType, pivotYValue
// Animation.ABSOLUTE[绝对位置] Animation.RELATIVE_TO_SELF[相对于自身]
ScaleAnimation sa = new ScaleAnimation(0, 2, 0, 2, Animation.RELATIVE_TO_SELF, 0.5f,Animation.RELATIVE_TO_SELF, 0.5f);
sa.setDuration(5000); //持续时间
iv.startAnimation(sa);
}
}
2、main.xml
-----------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="doc.guandang.net;
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<!-- android:scaleType="fitXY" 穿透XY -->
<ImageView
android:layout_marginTop="70dip"
android:layout_width="350dip"
android:layout_height="300dip"
android:background="#f00"
android:scaleType="fitXY"
android:src="@drawable/large2"
android:id="@+id/ivView"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/etText"
/>
</LinearLayout>
【注意:动画的xml 文件都是应该放置在 res/anim 文件夹下】
3、scale.xml 比例动画
-----------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="doc.guandang.net;
<!--
比例
渐变尺寸缩放动画效果 <scale/> ScaleAnimation
accelerate加速 decelerate减速
android:fromXScale="0.0"//起始时X轴比例(相较于图片本身)
android:fromYScale="0.0"
android:toXScale="5" //结束时y轴上的比例 放大多少倍
android:toYScale="5"
android:pivotX="50%" //x轴轴心
android:p
Android的动画animation详解_计算机软件及应用_IT/计算机_专业资料。总结android...值小于 1.0 表示收缩 37. 值大于 1.0 表示放大 38. 39. pivotX 属性为...
Android动画详解之Tween动画的转换_计算机软件及应用_IT/计算机_专业资料。www.tsingyuan.cn Android 动画详解之 Tween 动画的转换 一个 Tween 动画将对于 View ...
Android 动画效果 --Animation 动画专题研究_IT/计算机_专业资料。动画类型 ...35. 36. 37. 38. 39. 长整型值: duration 属性为动画持续时间 说明: 以上...
Android 动画开发——Animation 动画效果 Android 开发, 动画效果 动画类型 Android...37. 0.0 表示收缩到没有 1.0 表示正常无伸缩 值小于 1.0 表示收缩 值...
Android开发—Android动画编程基础_计算机软件及应用_IT/计算机_专业资料。Android...37 38 39 40 ?> <?xml version="1.0" encoding="utf-8"?> <scale ...
Android动画效果_计算机软件及应用_IT/计算机_专业资料。android动画知识详细讲解。Android 动画效果 Android 平台提供了一套完整的动画框架,使得应用开发者可以用它来...
专业 专注 创新 共赢 动画 Android在支持两种类型的动画:渐变动画 ( Tweened animations)和 帧动画( frame-byframe animations)。 渐变动画是对Android中的View增加...
麦子学院Android开发教程手势识别ViewFlipper触摸动画_计算机软件及应用_IT/计算机_...35. 36. 37. 38. 39. 40. 41. 42. 43. 44. import android.view....
android动画分类_IT/计算机_专业资料。android动画分类,与详细描述1、Tweened Animations 渐变动画 、该类 Animations 提供了旋转,移动,伸展和淡入淡出效果 1.1、 ...
Android动画与特效_计算机软件及应用_IT/计算机_专业资料。Android动画与特效Android 动画与特效一. Android 二维动画的分类 1. 补间动画(Tween Animation):采用对...
热门文档