Używam adapter = nowy SimpleCursorAdapter (this, android.R.layout.simple_list_item_multiple_choice, cur, cols, views), aby utworzyć formant wielokrotnego wyboru, , ale nie jestem zadowolony ze stylu widoku tekstowego w kontrolce wielokrotnego wyboru , więc muszę użyć następującego kodu, aby utworzyć nowy układ kontrolki wielokrotnego wyboru. Działa dobrze, ale nie sądzę, że to dobry sposób, czy jest jakiś dobry kod? Dzięki!Jak zastąpić styl android.R.layout.simple_list_item_multiple_choice?
adapter = nowy SimpleCursorAdapter (to, R.layout.mysimple_list_item_multiple_choice, cur, cols, widoki);
lv.setAdapter(adapter);
lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
mysimple_list_item_multiple_choice.xml
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:paddingLeft="6dip"
android:paddingRight="6dip"
android:ellipsize="end"
android:singleLine="true"
/>
przeglądać "adaptery custome" w Androidzie – Pinki