Scale Image to fill ImageView width and keep aspect ratio
Without using any custom classes or libraries: <ImageView android:id=”@id/img” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:adjustViewBounds=”true” android:scaleType=”fitCenter” /> scaleType=”fitCenter” (default when omitted) will make it as wide as the parent allows and up/down-scale as needed keeping aspect ratio. scaleType=”centerInside” if the intrinsic width of src is smaller than parent widthwill center the image horizontally if the intrinsic width of … Read more