我想在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