'Android Layout Background Won't fit to scale

I'm new to android programming and I'm having trouble setting my main layout's background since it won't scale.

there is a white border around background that wont go away so my background cannot fit entire screen. i loaded the image to my res/drawable-xhdpi folder and wrote code below.

This is my activityMain code:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:background="@drawable/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_margin="@dimen/activity_horizontal_margin"

>


Solution 1:[1]

==>> there is a white border around background 

This is due to the layout_margin, check out by removing android:layout_margin="@dimen/activity_horizontal_margin"

and then your background will fit .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ravikant Paudel