I am trying to set a background image for my Main Activity. I have created different drawable folders such as drawable-hdpi, drawable-mdpi, drawable-xhdpi, drawable-xxdpi, and drawable-xxxhdpi. I used Android asset studio to take one image and create a version of each image for each of the drawable folders.
Now when I try to add the background image in xml for the outermost layout like the following:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/layoutContainer"
android:orientation="horizontal"
android:background="@drawable/ic_background">
A background image does get produced in the designer, however it does not cover the full screen. Here is a screenshot of how it looks like:
As you can see it doesn't cover the whole screen. What is the issue?
I just realized something. On Android asset studio there was an option for size. It was originally at 28 dp and I kept it there. Is that he reason why the image is not taking up the whole screen?
Edit
So I made the image size to the max possibility on Anroid asset Studio which is 200 dp. I also made padding set to 0. Now the image take the whole screen vertically. However horizontally the image does not take up the whole background.