Android ImageView控件,图片如何铺满整个控件?

android imageView有一个属性就是scaleType扩大类型,使用fitXy值就可以实现铺满整个空间,操作如下:在ImageView里加上android:scaleType=“fitXy”。\x0d\x0a 默认还有其他很多类型:scaleType=“matrix” 是保持原图大小、从左上角的点开始,以矩阵形式绘图。\x0d\x0a\x0d\x0ascaleType=“fitXY” 是将原图进行横方向(即XY方向)的拉伸后绘制的。\x0d\x0a\x0d\x0ascaleType=“fitStart” 是将原图沿左上角的点(即matrix方式绘图开始的点),按比例缩放原图绘制而成的。

android:scaleType="fitXY"

猜你喜欢

转载自blog.csdn.net/qq_27494201/article/details/130031020