In my app, I am trying to make a 90-degree rotation animation on button click and after the click of the button the imageview should not go to its original rotation.
till I am am just able to do the rotation animation but not able to figure out how to keep the image rotated after the animation
RotateAnimation rotateAnimation=new RotateAnimation(0, 90, RotateAnimation.RELATIVE_TO_SELF,
.5f, RotateAnimation.RELATIVE_TO_SELF
,.5f);
rotateAnimation.setDuration(5000);
imageView.startAnimation(rotateAnimation);
CodePudding user response:
You can do it with animate()
.
For example:
imageView.animate().rotation(90).setDuration(5000).start()