Android ImageView ScaleType and item height

↘锁芯ラ 提交于 2019-11-28 23:11:46
Shubhayu

Use the scaletype which seems best to you ( I guess you like what you see with fitCenter). The additional thing that you must do is

android:adjustViewBounds="true"

in your ImageView.

or you could go with FitXY but sometimes the result is not exactly what you want.

use android:scaleType="fitXY"

Could you use FitXY? This would work if you knew the size of the area you were putting the image into. CentreInside may also work, I've used this to scale down images, but I think it depends if you've control of the size of the bounding layout element.

You either need to set android:height = "wrap_content" on your outer container, or set static height of TextBox and give ImageView android:weight = "1" so that the ImageView takes remaining space in container.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!