草庐IT

setImageMatrix

全部标签

android - 为什么 ImageView.setImageMatrix() 不起作用?

我想使用ImageView.setImageMatrix(matrix)旋转图像,但它根本没有任何效果。我调用matrix.postRotate(45,20,20);在将其传递给上面的函数但没有效果之前,图像不会旋转。为什么?matrix.postRotate(45,20,20);ImageView.setImageMatrix(matrix) 最佳答案 我不太确定,但我认为您应该设置比例类型:imgView.setScaleType(ScaleType.MATRIX);您也可以使用android:scaleType="matrix