Ich habe ein Problem in meinem ListView. Ich möchte den Hintergrund des ausgewählten Elements ändern, wenn ich es auf ein benutzerdefiniertes Zeichenformat auswähle, das ich habe, aber es funktioniert nicht.ListView ausgewählter Artikel ausziehbar
Ich möchte wie im Bild um diesen Effekt haben die SelectedItem
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true"
android:drawable="@drawable/selected_item"/>
<item android:drawable="@android:color/transparent" />
</selector>
Und dies ist der Text von list_row
<!-- this layout is used to view row of category list and resturant list -->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/txt_category_row"
android:gravity="center"
android:layout_width="match_parent"
android:textColor="@color/BLACK"
android:layout_height="55dp"
android:padding="10dp"
android:text="@string/hello"
android:layout_marginTop="5dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
Und das Listview code.xml
zu sein:
<ListView android:id="@+id/list_category"
android:layout_alignParentLeft="true"
android:layout_height="fill_parent"
android:layout_width="184dp"
android:dividerHeight="2px"
android:background="@android:color/transparent"
android:cacheColorHint="@android:color/transparent"
android:layout_marginTop="5dp"
android:listSelector="@drawable/list_selector"
android:divider="@color/Gray" >
es funktioniert, aber wenn ich ..can u ein anderes Element der brevious Ansicht Aufenthalt ausgewählt wählen helfen – Basant