1

I am currently using fragments in my app, and in it I have a listview. When I scroll It turns black and I can't figure out how to get rid of it.

I checked out this page : Background ListView becomes black when scrolling

This didn't work... any other ideas? (it's a listview with a picture and a text combined)

Community
  • 1
  • 1
Brandon Ling
  • 3,841
  • 6
  • 34
  • 49

4 Answers4

7

You can set like this

    <ListView 
         android:id="@+id/list01" 
         android:layout_height="fill_parent"
         android:layout_width="fill_parent"
         android:focusable="true"    
         android:fastScrollEnabled="true"
         android:focusableInTouchMode="true"
         android:transcriptMode="normal"
         android:cacheColorHint="@android:color/transparent"
         android:scrollingCache="false" 

         />

or can set like this

list.getDrawingCache(false);
list.setScrollingCacheEnabled(false);  
list.setCacheColorHint(Color.TRANSPARENT);
StarsSky
  • 6,721
  • 6
  • 38
  • 63
nikki
  • 3,248
  • 3
  • 24
  • 29
  • 1
    You cant believe android:scrollingCache="false" how important of this line to me it solve my big time problem thanks so much,,, –  Apr 22 '13 at 06:43
5

or you can also set attribute

android:cacheColorHint="@android:color/transparent"
android:scrollingCache="false"

in List View.

StarsSky
  • 6,721
  • 6
  • 38
  • 63
Ankitkumar Makwana
  • 3,475
  • 3
  • 19
  • 45
2

you can also try this

android:cacheColorHint="#00000000"
StarsSky
  • 6,721
  • 6
  • 38
  • 63
R.F
  • 312
  • 1
  • 16
1
<ListView
            android:id="@+id/listtask"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginTop="15dp"
            android:background="@drawable/back"
            android:divider="@drawable/divider"
            android:dividerHeight="1dp"
            android:padding="5dp"
            android:cacheColorHint="@android:color/transparent"
            android:scrollingCache="false" >
        </ListView>