Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset ImageView angle rotation to default? [closed]

Tags:

android

I have an ImagaView,in which I set the bitmap and made some rotation using onTouchListener concept.

If I set another Bitmap to same imageview,it is displaying in same angle which is left after doing rotation of previous image.

So,I just want the ImageView to come in default position.

Thanks

like image 898
user1891910 Avatar asked Nov 29 '25 16:11

user1891910


1 Answers

You already have code to rotate imageView when pinching use that to reset the imageview's rotation to 0(zero).

Btw the function to ratate a view is

myImageView.setRotation(float rotationInDegrees);

e.g.

myImageView.setRotation(0);

Call this when you apply the new image source to the imageview.

http://developer.android.com/reference/android/view/View.html#setRotation(float)

like image 63
Master Chief Avatar answered Dec 02 '25 06:12

Master Chief



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!