我需要知道如何暂停旋转动画:
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 :(得分:0)
使用animationTarget.clearAnimation()
尝试帮助
答案 1 :(得分:0)
public void pauseAnimation(View view) {
anim.pause();
//you need to define anim