ImageView Center Scale types review


## Prepare

- Source 1 (1600 x 1200):

<img src="https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/source_1.jpg" width="480px"/>

- Source 2 (480 x 360):

![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/source_2.png)

- Layout:

```xml
<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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_center_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_center_b-true.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_center_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_center_b-true.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_centerCrop_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_centerCrop_b-true.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_centerCrop_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_centerCrop_b-true.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_centerInside_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_centerInside_b-true.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_centerInside_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_centerInside_b-true.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_fitCenter_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_fitCenter_b-true.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_fitCenter_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_fitCenter_b-true.png) |


###### 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_center_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_center_b-true.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_center_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_center_b-true.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_centerCrop_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_centerCrop_b-true.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_centerCrop_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_centerCrop_b-true.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_centerInside_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_centerInside_b-true.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_centerInside_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_centerInside_b-true.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_fitCenter_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_fitCenter_b-true.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_fitCenter_b-false.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_fitCenter_b-true.png) |


#### 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_center_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_center_b-true_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_center_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_center_b-true_2.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_centerCrop_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_centerCrop_b-true_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_centerCrop_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_centerCrop_b-true_2.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_centerInside_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_centerInside_b-true_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_centerInside_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_centerInside_b-true_2.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_fitCenter_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-match_fitCenter_b-true_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_fitCenter_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-match_h-wrap_fitCenter_b-true_2.png) |


###### 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_center_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_center_b-true_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_center_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_center_b-true_2.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_centerCrop_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_centerCrop_b-true_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_centerCrop_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_centerCrop_b-true_2.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_centerInside_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_centerInside_b-true_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_centerInside_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_centerInside_b-true_2.png) |

- 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" |
|:----:|:----:|:----:|:----:|
| ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_fitCenter_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-match_fitCenter_b-true_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_fitCenter_b-false_2.png) | ![](https://raw.githubusercontent.com/eneim/eneim.github.io/resources/blog/2016/5/w-wrap_h-wrap_fitCenter_b-true_2.png) |