Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

What's the default ScaleType of ImageView? [duplicate]

Writer Matthew Martinez

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="" 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>
2

1 Answer

FIT_CENTER:

ImageView.ScaleType FIT_CENTER

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

1