在屏幕上有一个ImageView,我想让这个视图可以向左旋转,然后再向右旋转,我使用以下代码给ImageView添加动画:
new RotateAnimation(20f, 50f,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(700);
// Start animating the image
final ImageView splash = (ImageView) findViewById(R.id.mobileshake);
splash.startAnimation(anim);
问题是,现在ImageView的这个动画形式只能旋转一次。我想的是先向左旋转,然后再向右旋转。
如何能让ImageView动起来?