Android imageview, scale full screen, and centerCrop

android, imageview

Solution

You could simply use `adjustViewBounds` value to maintain the aspect ratio of the image

<ImageView
        android:id="@+id/metallicaImage"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:adjustViewBounds="true"
        android:src="@drawable/metallica" />

Problem

How can I have an imageview whose image fills the screen, but maintains its aspect ratio, and fits in the center? Currently I have large images, larger than phone screen resolution, but I suspect that they will be be letterboxed on devices with higher resolution What combination of `scaleType` will do the trick?

Original source

Related problems