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;
   }
}
4

2 回答 2

0

如果有帮助,请使用animationTarget.clearAnimation()尝试

于 2013-03-27T01:46:05.057 回答
0
public void pauseAnimation(View view) {
anim.pause();
//you need to define anim
于 2019-10-07T09:28:39.540 回答