如何使用相同的按钮旋转每个图像

时间:2016-02-07 09:04:11

标签: android image rotation

[我http://i.stack.imgur.com/I26fq.png][1

  

我有两张图片。如何使用相同的按钮旋转每个图像

1 个答案:

答案 0 :(得分:1)

imageViewanglepivotX& pivotY应根据要求定义

import android.graphics.Matrix;
import android.widget.ImageView;

Matrix matrix = new Matrix();
imageView.setScaleType(ImageView.ScaleType.MATRIX);   
matrix.postRotate((float) angle, pivotX, pivotY);
imageView.setImageMatrix(matrix);