2013-03-27 32 views
1

我需要知道我如何暫停我的旋轉動畫:如何創建一個停頓旋轉動畫

public void onClick(View v) 
{ 
    ImageView animationTarget = (ImageView) this.findViewById(R.id.ImgWheel); 

    switch (v.getId()) 
    { 
     case R.id.playButton: 

     playBtn.setVisibility(Button.INVISIBLE); 
     pauseBtn.setVisibility(Button.VISIBLE); 
     Animation animation = AnimationUtils.loadAnimation(this, R.anim.rotate_around_center_point); 
     animationTarget.startAnimation(animation); 
     break; 

     case R.id.pauseButton: 

     pauseBtn.setVisibility(Button.INVISIBLE); 
     playBtn.setVisibility(Button.VISIBLE); 

     //here is where i may put the pause button codes// 

     break; 
    } 
} 

回答

0

使用animationTarget.clearAnimation()嘗試,如果有助於

+2

它不會停下......它只是重新啓動動畫... – 2013-03-27 02:20:07