views:

45

answers:

1

I'm trying to display an image before the list in a listactivity.

If I put an ImageView before the ListView, then only the list is displayed... still quite an android n00b so any pointers appreciated :)

Heres my main.xml which lays out the list activity:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <ImageView android:id="@+id/header"
      android:src="@drawable/header"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="top"
      android:scaleType="fitStart"
      />

    <ListView android:id="@+id/android:list" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:scaleType="fitEnd"
        />
</LinearLayout>
+1  A: 

OK... I was missing android:orientation="vertical"

It seems to work now :)

Stuart Axon