I am using the following code to rotate a image in ImageView by an angle. Is there any simpler and less complex method available.
ImageView iv = (ImageView)f
Also, if you want to rotate an ImageView by 180 degrees vertically or horizontally, you can use scaleY
or scaleX
properties and set them to -1f
. Here is a Kotlin example:
imageView.scaleY = -1f
imageView.scaleX = -1f
1f
value is used to return an ImageView to its normal state:
imageView.scaleY = 1f
imageView.scaleX = 1f