scaleType和wrap_content如何确定ImageView的宽度和高度?

问题描述 投票:0回答:1

我试图了解layout_width / heightscaleType一起设置为“ wrap_content”,“ goes”时的情况?AFAIK,scaleType(例如'center_fit')负责放大或缩小图像尺寸,但是当width或height设置为wrap_content时,不是表示宽度& ImageView的高度将根据图像(可绘制)的大小进行计算吗?那么,为什么在这种情况下可绘制对象将全部缩放?

java android imageview android-xml scaletype
1个回答
1
投票

scaleType定义在宽度和高度不匹配/不合适的情况下您希望图像显示的方式,例如fitCenter使它居中并适合,而fitXY则在有空格时将其拉伸。

© www.soinside.com 2019 - 2024. All rights reserved.