Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stretch image in imageview to fit screen in xml

I have image in drawable, which needs to work as the background. It needs to stretch to fill the screen.. I know how to stretch the image full screen using java code.. but in XML itselt how can do this.

like image 682
Prakash M Avatar asked Jun 17 '15 10:06

Prakash M


2 Answers

android:scaleType="fitXY" will stretch the image to fit the full size of the ImageView

like image 74
Vinothkumar Arputharaj Avatar answered Oct 19 '22 04:10

Vinothkumar Arputharaj


Try with this property:

android:scaleType="fitXY"

Here you can find other constant values for resizing.

like image 21
flyingAssistant Avatar answered Oct 19 '22 04:10

flyingAssistant