【Android】ImageView.scaleType
作者:
Wavky | 来源:发表于
2017-03-30 09:17 被阅读0次
标准缩放模式
-
center
ImageView 居中显示,不缩放
-
centerCrop
等比缩放,填满 ImageView 并居中显示(不保证图片完整)
-
centerInside
等比缩小,令图片居中并完整显示(小尺寸图片不进行放大)
-
fitCenter
等比缩放,令图片居中并完整显示
-
fitStart
等比缩放,令图片完整显示,左上角对齐
-
fitEnd
等比缩放,令图片完整显示,右下角对齐
-
fitXY
按 ImageView 宽高缩放,填满 ImageView
-
matrix
按给定矩阵缩放,默认为原图输出,左上角对齐
Matrix缩放
<ImageView
android:scaleType="matrix" />
Matrix matrix = new Matrix();
matrix.setScale(widthRate, heightRate, pivotX, pivotY);
...
imageView.setImageMatrix(matrix);
本文标题:【Android】ImageView.scaleType
本文链接:https://www.haomeiwen.com/subject/ndjuottx.html
网友评论