Learning Android Development

Android ImageView ScaleType Fully Illustrated

Clear all confusion of Android Image ScaleType

Photo by Emiliano Vittoriosi on Unsplash

I thought I know what Android ImageView ScaleType behavior is until I see the below. Sometimes the CenterInside is the same as FitCenter. Sometimes the CenterInside is the same as the Center. Confusing?! 🧐

Different scale types produce the same result, confusing.

If you search the internet, the above differences are not described clearly. So I decided to flush out my confusion entirely by providing a full illustration of all ScaleType that behave differently across different sizes of images.

Images Size Type

To fully illustrated them, I have to use there are 4 types of images

  1. Bigger Image: Both height and width of the image are bigger than the Device View. I use the waterfall image for this.
  2. Smaller Image: Both height and width of the image are smaller than the Device View. I use the lion image for this.
  3. Taller Image: Only the height of the image is bigger than the device, the width is smaller. I use the tree image for this.

--

--