Android: Rotate image in imageview by an angle

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

    This is my implementation of RotatableImageView. Usage is very easy: just copy attrs.xml and RotatableImageView.java into your project and add RotatableImageView to your layout. Set desired rotation angle using example:angle parameter.

    
    
        
    
    

    If you have some problems with displaying image, try change code in RotatableImageView.onDraw() method or use draw() method instead.

提交回复
热议问题