Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background image in constraints layout does not work

I want my app to use a image in the background for signup and signin function. I am using android studio 2.3 and so far I can see that lot many things have changed since last year. Where we used relative or linearlayout now that is constraint layout. I included a code with the root layout as:

android:background="@drawable/wallpaper_2"
    android:orientation="vertical"

Check this image for more information: enter image description here

enter image description here

When I test this app on my Nexus 5 it does not show anything just a blank screen but the it shows the same image on the preview screen. Any help would be appreciated on this.

like image 281
Karan Thakkar Avatar asked Feb 05 '23 15:02

Karan Thakkar


1 Answers

The resolution of your image is too large for the device resize your picture to smaller dimesions and based on that put your image into specific drawable folder. e.g : If image size is 1280 x 720 than put image in drawable-xxhdpi folder.

like image 92
Haris ali Avatar answered Feb 07 '23 11:02

Haris ali