我想在RelativeLayout中多次渲染ImageView。 要做到这一点,我使用:在不改变大小的情况下旋转imageView Android
angleRotation = angleRotation + (float)90;
Rect bounds = imgToRotate.getDrawable().getBounds();
Matrix matrix=new Matrix();
imgToRotate.setScaleType(ScaleType.MATRIX); //required
matrix.postRotate((float) angleRotation, bounds.width()/2 , bounds.height()/2);
imgToRotate.setImageMatrix(matrix);
的问题是,我使用矩阵改变我的ImageView的大小。我不知道如何不改变大小。
任何帮助?非常感谢你。
你的意思是图像改变了尺寸以便缩小/缩小?或者图像不是方形的,你的意思是newWidth = oldHeight && newHeight = oldWidth? – 2014-08-31 16:47:46
我的意思是图像保持比例,但它被缩小。 – user2335528 2014-08-31 16:50:27