View動畫的簡單使用

  1. Animation animation = AnimationUtils.loadAnimation(Context, R.anim.anim_slide_out_from_bottom);  
  2.     animation.setInterpolator(new  
  3.   
  4.     DecelerateInterpolator()  
  5.   
  6.     );  
  7.     animation.setAnimationListener(new Animation.AnimationListener()  
  8.   
  9.     {  
  10.   
  11.         @Override  
  12.   
  13.         public void onAnimationStart (Animation animation){  
  14.   
  15.   
  16.     }  
  17.   
  18.   
  19.         @Overridepublic void onAnimationEnd (Animation animation){  
  20.   
  21.     }  
  22.   
  23.         @Override  
  24.   
  25.         public void onAnimationRepeat (Animation animation){  
  26.   
  27.     }  
  28.   
  29.     }  
  30.   
  31.     );  
  32.    xxxview.clearAnimation();  
  33.    xxxview.startAnimation(animation);  
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章