The different scaletypes are:
- center
- centerInside
- centerCrop
- fitXY
- fitStart
- fitCenter (which is the default)
- fitEnd
- matrix (can be used for transformations but is not covered here)
This post will just simple show the different scaletypes with a screenshot of how it looks in the app.
Here's the code of my layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/logo" android:scaleType="centerCrop" /> </RelativeLayout>