如何改变所选项目的颜色从多选的ListView
问题描述:
我有作为列表视图:如何改变所选项目的颜色从多选的ListView
<ListView
android:id="@+id/ListView01"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:cacheColorHint="@android:color/transparent" />
在相应的活动我已经设置在列表视图的元件
listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_multiple_choice, phoneContactList));
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
在上面的代码
,phoneContactList
是一个arrayList。
的onClick从列表项的,如何可以改变它的颜色?
谢谢。
[见这里...(http://samir-mangroliya.blogspot.in/p/android-read-contact-and-display-in的.html) – 2012-07-13 12:10:27
您将获得所选项目的位置上onItemClickListener,通过这个你可以改变颜色 – AkashG 2012-07-13 12:10:51