There are various XML attributes for ImageView to scale its content , and various layout views that allow to place views and set their sizes.
Howeve
You need a combination of three attributes:
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
The adjustViewBounds
attribute is needed because ImageView
measures itself to match the original dimensions of the drawable by default, without regard to any scaling performed according to the scale type.