Wie kann ich ein Hintergrundbild einstellen, für jedes item der ListView in Android?

<?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="?android:attr/listPreferredItemHeight"
    android:padding="6dip">
    <ImageView
        android:id="@+id/icon"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_marginRight="6dip"
        android:src="@drawable/icon" />
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="fill_parent">
        <TextView
            android:id="@+id/toptext"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:textStyle="bold"
        />
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
            android:id="@+id/bottomtext"
            android:singleLine="false"
        />
    </LinearLayout>
</LinearLayout>

Dies ist meine aktuelle Zeile. Wenn ich ein .JPEG, und ich möchte, dass für jedes Element...wie würde ich das ändern .xml-Datei? Wo würde ich das Bild? In Vermögen?

InformationsquelleAutor TIMEX | 2010-02-16

Schreibe einen Kommentar