@linux1s1s
2017-01-22T08:26:14.000000Z
字数 1142
阅读 3006
AndroidAnimation 2016-06
Android 中动画一般有三种
这里仅仅介绍前两种,比较复杂的属性动画将在另外一篇博客中单独介绍
通过对场景里的对象不断做图像变换(平移、缩放、旋转)产生动画效果,即是一种渐变动画。
渐变动画的四个属性
然后直接看一下Demo做个直观的了解
<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android"android:fillAfter = "false"android:zAdjustment="bottom"><rotateandroid:fromDegrees="0"android:toDegrees="360"android:pivotX="50%"android:pivotY="50%"android:duration="4000"/></set>
Animation anim = AnimationUtils.loadAnimation(mContext, R.anim.rotate);anim.setAnimationListener(new EffectAnimationListener());textWidget = (TextView)findViewById(R.id.text_widget);textWidget.setText("Rotate Now");textWidget.startAnimation(anim);
Frame Animation是顺序播放事先做好的图像,跟电影类似。
Android SDK提供了AnimationDrawable类来定义使用Frame Animation。
参考:
http://developer.android.com/training/animation/crossfade.html
关于属性动画这里可以参考文章:
http://blog.csdn.net/lmj623565791/article/details/38067475
http://www.cnblogs.com/kissazi2/p/4249213.html
