Android: disabling highlight on listView click
Add this to your xml:
android:listSelector="@android:color/transparent"
And for the problem this may work (I'm not sure and I don't know if there are better solutions):
You could apply a ColorStateList to your TextView.
From ListView: Disable Focus Highlight,
when you set your ListAdapter
use the following code
ListAdapter adapter = new SimpleCursorAdapter(MyList, Layout, c,
new String[] { "Name", "Score" }, to)
{
public boolean areAllItemsEnabled()
{
return false;
}
public boolean isEnabled(int position)
{
return false;
}
};
This will override the BaseAdapter
class. It also cancels the white border between cells.
RoflcoptrException's answer should do the trick,but for some reason it did not work for me, So I am posting the solution which worked for me, hope it helps someone
<ListView
android:listSelector="@android:color/transparent"
android:cacheColorHint="@android:color/transparent"
/>
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.
see this for short and quick solution https://stackoverflow.com/a/12242564/185022