1

I want to set the background to LinearLayout , I took reference from this. But still it lefts spaces to 4 sides. screen shot is screenshot

Code is the following

   <FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@mipmap/background"
        android:scaleType="fitXY" />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">
<someviews></someviews>
 </LinearLayout>
</FrameLayout>

Please give some solution if any.

Kiran S Kulkarni
  • 215
  • 1
  • 2
  • 16

2 Answers2

0
  • Use android:src instead of android:background.
  • Add android:adjustViewBounds="true"

Sets a drawable as the content of this ImageView.

Finally

<ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@mipmap/background"
        android:scaleType="fitXY"
        android:adjustViewBounds="true" />
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0
<resources>

<dimen name="activity_horizontal_margin">0dp</dimen>
<dimen name="activity_vertical_margin">0dp</dimen>
</resources>

check dimen.xml file put 0dp horizontal and vertical margin

abuosama
  • 19
  • 2
  • 3