Android: Rotate image in imageview by an angle

前端 未结 25 2609
野趣味
野趣味 2020-11-22 06:35

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         


        
25条回答
  •  情歌与酒
    2020-11-22 07:17

    if u want to rotate an image by 180 degrees then put these two value in imageview tag:-

    android:scaleX="-1"
    android:scaleY="-1"
    

    Explanation:- scaleX = 1 and scaleY = 1 repesent it's normal state but if we put -1 on scaleX/scaleY property then it will be rotated by 180 degrees

提交回复
热议问题