Android: Rotate image in imageview by an angle

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

    I think the best method :)

    int angle = 0;
    imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                angle = angle + 90;
                imageView.setRotation(angle);
            }
        });
    

提交回复
热议问题