I use a ListView
in my layout like this:
<ListView android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_gravity="center"
android:layout_height="match_parent"
android:layout_weight="0.7"
android:layout_marginTop="5dp"
android:orientation="vertical"
android:layout_centerInParent="true"
android:divider="@color/dark_grey"
android:drawSelectorOnTop="false"
android:focusable="true"
android:layout_marginBottom="55dp"
android:cacheColorHint="#00000000"
android:listSelector="@color/light_grey"
android:dividerHeight="1px" />
The selector works great but how can I disable the selector?
I tried:
listView.clearChoices();
listView.setSelected();
listView.setSelector();
...
and a few more things but nothing works. Any ideas how I can turn my selected item back to normal? Can't be that complicated, right?
Edit: I need a programmatical solution!
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…