ImageView not rotating
ImageView
is not rotating ?
ImageView arrow1;
arrow1 =(ImageView) findViewById(R.id.arrow1);
Matrix mtx =开发者_JS百科 new Matrix();
mtx.postRotate(90);
arrow1.setImageMatrix(mtx);
Any Suggestions?
Now Image rotating
arrow1 = (ImageView) findViewById(R.id.arrow1);
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.arrow1);
bmpWidth = bitmap.getWidth();
bmpHeight = bitmap.getHeight();
float curScale = 1F;
Matrix matrix = new Matrix();
matrix.postScale(curScale, curScale);
matrix.postRotate(90);
if(resizedBitmap!=null){
resizedBitmap.recycle();
}
resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, bmpWidth, bmpHeight, matrix, true);
arrow1.setImageBitmap(resizedBitmap);
精彩评论