Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android listview produces black highlighting over text when scrolling. How to stop this?

Tags:

android

Duplicate:

Background ListView becomes black when scrolling

I have a listview within which each item contains black text on a white background. When testing on a Nexus One, when scrolling down to read through the text, a black highlight appears over the text and makes it unreadable.

I am trying to figure out what is this setting so I can turn it off. I do not want anything to get highlighted when scrolling down through the list. How can I accomplish this?

Thanks.

like image 257
JohnRock Avatar asked May 08 '10 04:05

JohnRock


2 Answers

You probably want to set the cacheColorHint to the same color as your background.

So, when you're defining your layout, just add android:cacheColorHint='#fff' to your ListView:

<ListView android:id="@+id/list"
    android:cacheColorHint="#fff"
    android:background="#fff"
    ...etc />
like image 85
synic Avatar answered Sep 28 '22 00:09

synic


This may be a trick:

android:cacheColorHint="@android:color/transparent" 
like image 39
Paresh Mayani Avatar answered Sep 28 '22 01:09

Paresh Mayani