Android: Rotate image in imageview by an angle

前端 未结 25 2961
野趣味
野趣味 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:11

    Another possible solution is to create your own custom Image view(say RotateableImageView extends ImageView )...and override the onDraw() to rotate either the canvas/bitmaps before redering on to the canvas.Don't forget to restore the canvas back.

    But if you are going to rotate only a single instance of image view,your solution should be good enough.

提交回复
热议问题