Search code examples
androidexpandablelistviewhighlighting

How to prevent irrelevant highlighting on listview in Android v2.3.3?


I am executing same code on both v4.0.1( #1 ) and v2.3.3( #2 ) on android, but I am getting different responses at which one(#2) of them is disturbing. I have ExpandableListView on my gui. when I try to slide down the list, whole expandableListView blacks out and sometimes(actually more than sometimes) it stays after releasing my hand from screen. Amount of sliding is not important, but it stucks at black. I will show you with images below:

this is normal version:

normal version

this is what I meant:

https://dl.dropbox.com/u/49240706/1.png

TY in advance.


Solution

  • Try to set cacheColorHint to transparent.

    Using XML:

    <ExpandableListView
        android:id="@+id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:cacheColorHint="@android:color/transparent" />
    

    OR using code:

    final ExpandableListView list = ...;
    list.setCacheColorHint(Color.TRANSPARENT);