Einstellung Hintergrundbild für ein ListView

Hey Leute das problem mit dem einstellen eines hintergrund-Bild auf meinem ListView. Code ist wie folgt

history.xml

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

<ListView android:id="@id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:cacheColorHint="#00000000"
    android:layout_weight="1"
    android:drawSelectorOnTop="false"
    android:src="@drawable/back">
    </ListView>

<TextView  android:id="@id/android:empty"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#FFff00"
    android:text="No data"
    android:cacheColorHint="#00000000"
    />
</LinearLayout>

rowlayout.xml

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

<TextView android:id="@+id/ProductName"       
    android:textSize="25sp"         
    android:textColor="#FFFF00"        
    android:layout_width="fill_parent"         
    android:layout_height="wrap_content"
    />

</LinearLayout>

Java-Code

...

setListAdapter(new ArrayAdapter<String>(this, R.layout.rowlayout,R.id.ProductName,Names));

...

Ich weiß nicht, was ich hier mache, aber der hintergrund nicht angezeigt wird. Seine schwarzen ganzen. Wenn ich den hintergrund auf die text-Ansicht in rowlayout.xml es erscheint dann aber wie seine ganze Bildschirm trägt, ist ein Eintrag der ListView. Versucht, eine Menge von tutorials. Vielleicht tun einige rookie Fehler.. helfen Sie mir bitte heraus

Schreibe einen Kommentar