What's the default ScaleType of ImageView?

Android

Android Problem Overview


What's the default ScaleType of ImageView?If I put an image which is 400 pixels x 400 pixels on a normal screen (320x480) without specifying ScaleType, how will the image be scaled?

Thanks.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

	<ImageView 
	    android:layout_width="fill_parent"
	    android:layout_height="fill_parent"
	    android:src="@drawable/big_image"
	/>
</RelativeLayout>

Android Solutions


Solution 1 - Android

FIT_CENTER: > ImageView.ScaleType FIT_CENTER > Scale the image using CENTER. From XML, use this syntax: android:scaleType="fitCenter".

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser256239View Question on Stackoverflow
Solution 1 - AndroidRobby PondView Answer on Stackoverflow