What's the default ScaleType of ImageView? [duplicate]
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
1
ImageView.ScaleTypeFIT_CENTERScale the image using
CENTER. From XML, use this syntax:android:scaleType="fitCenter".