I have an image in drawable that should work as a background. It needs to stretch to fill the screen. I know how to stretch an image to full screen using java code .. but in XML itselt how to do it.
android:scaleType="fitXY" stretch the image to full size ImageView
android:scaleType="fitXY"
ImageView
Try with this property:
Here you can find other constant values for resizing.
ImageView ic_launcher , .
<ImageView android:id="@+id/mImageView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scaleType="fitXY" android:src="@drawable/ic_launcher" />
, .
I prefer to use scaleType = "centerCrop". Thus, the image is not stretched from the original proportions.