I have a layout, with a image, button and a textview. When I set image as backgroung, this background image is only Half of screen, and the rest is black. This method is good on other layout where i have bunch of stuff, but here it is only on half of the screen. How can i make this right ??
My layout:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_height="wrap_content" android:layout_width="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="@drawable/background"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="fill_parent"
android:src="@drawable/bonbon"
android:id="@+id/imageView1"
android:layout_height="wrap_content"/>
<cro.perger.bonbon.MyTextView
android:id="@+id/textView1"
android:text="Stanje aktiviranih paketa"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<Button android:layout_height="wrap_content"
android:text="Provjeri stanje"
android:id="@+id/provjeriStanje"
android:layout_width="fill_parent"/>
<TextView android:text=" "
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</ScrollView>
You have a ScrollView as a root component, it has it’s height defined as “wrap_content”. This is, most likely, the cause of your issue. Try this version: