<alpha xmlns:android="http://schemas.android.com/apk/res/android" android:fromAlpha="1" android:toAlpha="1" android:duration="1000" > </alpha> <scale android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:fromXScale="2.0" android:toXScale="1" android:fromYScale="2.0" android:toYScale="1" android:pivotX="50%" android:pivotY="50%" android:duration="1000"/> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:toDegrees="10" android:pivotX="50%" android:pivotY="50%" android:duration="1000" > </rotate> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="0" android:toXDelta="20" android:fromYDelta="0" android:toYDelta="20" android:duration="1200" > </translate>
// 加载动画
Animation animation1 = AnimationUtils.loadAnimation(this,R.anim.animation1);
animation1.setFillAfter(true);//停留在动画结束出,在xml中设置无效
// 动画开始 this.iv1.startAnimation(animation1); animation1.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation arg0) { } @Override public void onAnimationRepeat(Animation arg0) { } @Override public void onAnimationEnd(Animation arg0) { //启动第二个 iv2.setVisibility(View.VISIBLE); iv2.startAnimation(animation2); } });
原文链接:https://www.f2er.com/xml/296933.html