简体   繁体   中英

How does scaleType and wrap_content determine ImageView width and height?

I'm trying to understand how layout_width/height when sets to "wrap_content", "goes" together with scaleType ? AFAIK, scaleType (let's say 'center_fit' ) responsible of scaling up or down image size, but when width or height is set to wrap_content , isn't it means that the width & height of the ImageView will be calculated from the image (drawable) size? So why in this situation, the drawable will be scaled at all?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM