I have a question, how do you resize a background image in android studio to match the whole layout for example:
I have a drawable that is landscape by default, but my layout is horizontal, I want to decrease the width and increase the height of thag photo to match thr layout, how do I do that??
Question posted in Android Studio
The official documentation can be found here.
The official documentation can be found here.
4
Answers
You need to scale your image, add this property and change the fitCenter by the one that corresponds to your criteria
android:scaleType="fitCenter"
.Hope this helps. I think you have to add :
But still, check out the link I attached, so you can have a better understanding.
There are android scale types which you can refer CENTER, CENTER_CROP, CENTER_INSIDE, FIT_CENTER, FIT_END, FIT_START, FIT_XY and MATRIX. which can be used as per your requirement. But as you mentioned you can try
android:scaleType="center_crop"
which crops the image a bit but covers the whole screenThis Should do the trick