Disable Android ListView selector

6.2k views Asked by At

I am trying to disable the ListView selector on my ListView. I set the List Selector color to a transparent color. This seems to do the trick, but when I select certain text, they change colors. How can I make things work ok?

5

There are 5 answers

0
dudeldidadum On BEST ANSWER

It's not the best solution, but for me it worked:

You can set the text color manually (in xml or at runtime)

0
King of Masses On

Apply below code to your list view.

android:listSelector="@android:color/transparent"
0
Stefan Bossbaly On

You can change the color of selected items to match your background. This question was asked here.

3
Mick Byrne On

In your XML where you declare the ListView use:

<ListView android:id="@+id/my_list" android:listSelector="#00000000" />
0
citizen conn On

Are you looking for ListView 's setClickable(false) and setEnabled(false) method ?