2

use Tween Animation code:

 @Override
 public void onClick(View v) {
    RotateAnimation rotateAnimation = new RotateAnimation (0,90,Animation.RELATIVE_TO_SELF,0,Animation.RELATIVE_TO_SELF,0);
    rotateAnimation.setDuration (2000);
    rotateAnimation.setFillAfter (true);
    image2.startAnimation (rotateAnimation);
}  

of cause use Tween Animation can do that,but Tween Animation hava a defect.
For example the following gif click event does not move. So I want use property Animation to do that,but I found property Animation can only rotate around the Center.
how can i use property Animation to rotate view around the point? tween Animation

mio4kon
  • 1,503
  • 1
  • 10
  • 15

1 Answers1

0

I think from your question that you want rotation around the mouse pointer.

Try this, I think it should work but I haven't had a chance to try it yet.

...
Animation rotateAnimation  = new RotateAnimation(0.0f, 360.0f,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                0.0f);
...
Tim Ashton
  • 436
  • 6
  • 18