android animation
说到动画,跟flash这种动画区别还是很大,肯定没有那么自由,所有对于一个动画的对象肯定要封装大量的数据,数据的表现形式有两种,一种是静态
另外一种就是动态~android就是比较固定的集中形式,当然可以自由组合。
<translate> 主要是位置的变化
<scale>只要是尺寸的变化
<rotate>旋转的变化
1.静态格式-> xml file
Alpha Change
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <alpha android:fromAlpha="0.1" android:toAlpha="1.0" android:duration="3000" /> </set>
reference from:http://www.eoeandroid.com/forum.php?mod=viewthread&tid=564
examples:
渐变右出
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="1500"
android:fromXDelta="0"
android:toXDelta="100%p"
android:repeatCount="1000"
/>
<alpha
android:duration="1500"
android:fromAlpha="1.0"
android:toAlpha="0.1"
android:repeatCount="1000"/>
</set>
载入动画
imageView.startAnimation(AnimationUtils.LoadAnimation(this,R.anim.push_right_out)); 这样就可以了
2.动态的设置
animation=new TranslateAnimation(1, 1, 1, 100);
imageView.startAnimation(animation);
其实也很简单,当然动画的种类还有很多,自己可以组合


浙公网安备 33010602011771号