Is there a way to proportionally set the height of an ImageView if the width is set to android:layout_width="fill_parent"
?
It appears there is no direct way of adjusting an ImageView without skewing one of it's dimensions. This seems 开发者_开发问答bizarre given the application is expected to support a slew of screen sizes and resolutions.
You can use wrap_content
for the height and set the correct scale type (either in code or via the android:scaleType
attribute in XML). You are probably looking for CENTER_INSIDE
/android:scaleType="centerInside"
.
See ImageView.ScaleType
精彩评论