Edited at

ImageView Center Scale types review

More than 3 years have passed since last update.


Prepare


  • Source 1 (1600 x 1200):


  • Source 2 (480 x 360):


  • Layout:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#3e3639"
>

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="16dp"
android:background="#ea5444"
android:cropToPadding="false"
android:padding="16dp"
android:adjustViewBounds="false"
android:scaleType="center"
android:src="@drawable/io16_social"
/>

</FrameLayout>


Reviews


A. SDK 23, Source 1.


I. layout_width="match_parent"


  • 1 ScaleType = center

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 2 ScaleType = centerCrop

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 3 ScaleType = centerInside

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 4 ScaleType = fitCenter

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





II. layout_width="wrap_content"


  • 1 ScaleType = center

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 2 ScaleType = centerCrop

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 3 ScaleType = centerInside

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 4 ScaleType = fitCenter

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





B. SDK 23, Source 2.


I. layout_width="match_parent"


  • 1 ScaleType = center

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 2 ScaleType = centerCrop

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 3 ScaleType = centerInside

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 4 ScaleType = fitCenter

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





II. layout_width="wrap_content"


  • 1 ScaleType = center

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 2 ScaleType = centerCrop

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 3 ScaleType = centerInside

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"





  • 4 ScaleType = fitCenter

layout_height="match_parent", adjustViewBounds="false"
layout_height="match_parent", adjustViewBounds="true"
layout_height="wrap_content", adjustViewBounds="false"
layout_height="wrap_content", adjustViewBounds="true"