android listactivity Hintergrundfarbe
Wie kann ich die Hintergrundfarbe einer Listaktivität einstellen? Ich kann die Hintergrundfarbe der Listenansichten festlegen, aber nicht die gesamte Aktivitätsansicht (siehe den schwarzen Teil unten im Bild). Wie kann ich das erreichen?
Das ListActivity-XML sieht folgendermaßen aus:
<code><?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5dp" android:background="@color/darkbluelogo" > <ImageView android:id="@+id/list_image" android:layout_width="48dip" android:layout_height="48dip" android:contentDescription="@id/list_image" /> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp" android:background="@color/darkbluelogo" android:scrollingCache="false" android:cacheColorHint="#00000000" > <TextView android:id="@+id/title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@+id/title" > </TextView> <TextView android:id="@+id/datetime" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@+id/datetime" > </TextView> </LinearLayout> </LinearLayout> </code>
Und so sieht es auf dem Gerät aus:
LÖSUNG:
Ich musste einen XML-Stil hinzufügen und diesen zur Aktivität in der AndroidManifest.xml hinzufügen
Das war die richtige Antwort:https://stackoverflow.com/a/10426474/1306012