加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xml文件动画

发布时间:2020-12-16 09:12:06 所属栏目:百科 来源:网络整理
导读: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
<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); } });

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读