Scale an image up to fill entire ImageView in Android

In some cases all you need is

android:adjustViewBounds="true"

Try scaleType attribute for your ImageView. http://developer.android.com/reference/android/widget/ImageView.html#attr_android:scaleType


You can use android:scaleType="centerCrop". Keeps the aspect ratio and scales the image just like you want it.

For more information please go through the below link

http://developer.android.com/reference/android/widget/ImageView.html#attr_android:scaleType


imageView.setScaleType(ImageView.ScaleType.FIT_XY);

This worked for me to fit the image inside the whole image view, plus it make sense that it says "ScaleType.FIT_XY" to fit the X and Y axis of the imageView.

From the xml file it would be:

android:scaleType="fitXY"