Problem and Solution: Background ListView becomes black when scrolling after populated data on list


I have faced background ListView becomes black when scrolling after populated data on list, after that i have  found easy solution from stackoverflow.


Add an attribute on the ListView Tag

android:cacheColorHint="#00000000"

More details about this problem, go to android blog: http://android-developers.blogspot.com/2009/01/why-is-my-list-black-android.html

or alternate solutions , may be if the above trick not working then try this:

It's very simple just use this line in your layout file :

android:scrollingCache="false"
l
ike this:

<ListView 
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollingCache="false"
/>

finally, both of the above not working try this also:

list.setCacheColorHint(Color.TRANSPARENT);
list.requestFocus(0);


if all the above not working then please visit:  http://developer.android.com/reference/java/util/List.html
and
http://developer.android.com/guide/topics/ui/layout/listview.html

Happy Coding!!!

Problem and Solution: Background ListView becomes black when scrolling after populated data on list Problem and Solution: Background ListView becomes black when scrolling after populated data on list Reviewed by D Kshetri on 9:52 PM Rating: 5

No comments:

Powered by Blogger.