1

Here is my layout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/backg"
    android:paddingTop="40dp"
    android:orientation="vertical"
    tools:context=".AppleActivity" >
...
<LinearLayout>

I expect the background to fill the layout. But it leaves considerable space based on top and at the bottom. I don't mind if the background stretches. I just want it to fill the view. Does anyone know what might be causing this problem?

In case it's important: in my manifest file I am using android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" to hide the status bar.

learner
  • 11,490
  • 26
  • 97
  • 169

2 Answers2

0

try something like this..

<RelativeLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/backg"
 android:orientation="vertical">
williamj949
  • 11,166
  • 8
  • 37
  • 51
0

Have you tried adding

android:scaleType="fitXY"

into your linear layout? This will stretch your background image to linear layout bounds. You can also use centerCrop to fit the image to bounds without stretching it.

android:scaleType="centerCrop"

Also, use margin instead of padding.