views:

1047

answers:

3

I want to disable the orange highlight that occurs when touching a listView row. So far in my xml I have tried the following:

android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"

More information: I want there to be zero difference when a user touches the screen on this listView object.

+1  A: 

The orange highlight effect is a style on the ListView. This article gives a good overview of how to override the listView style.

Essentially, you have a selector that specifies different style elements based on the current state.

Mayra
Will this method allow me to have a different style for each listView object? Also, is it possible to avoid the issue I brought up in Sebi's answer?
John Moffitt
Yes, you can override any style attributes. You can specifically assign a style to each ListView using the style="@style/MyStyle" attribute as described in the first link.
Mayra
A: 

add this to your xml:

android:listSelector="@android:color/transparent"

and for the problem this may work (im note sure and i dont know if there are better solutions):

you could apply a ColorStateList to your TextView

Roflcoptr
This is close to what I am looking for as the background stays black, however the text still darkens a little on selection.
John Moffitt
Im not sure if it works or if it is a good solution but for that you could maybe use the code from my edit above
Roflcoptr