views:

75

answers:

2

Hello,

My layout contains a ListView (the parent is a LinearLayout). I have defined a certain drawable to be the ListView's background.
When I press an empty space below the last row, all the list rows turn black.
I'd like to attach screenshots but for some reason it adding images here doesn't work for me...

  1. Can someone explain how to attach screenshot?
  2. Any idea why this happens? Couldn't catch any click event in this activity...

Thanks, Rob

+2  A: 

Not sure if this is what's causing your problem, but have you read this post? http://developer.android.com/resources/articles/listview-backgrounds.html

Andreas Borglin
That did it! I needed to disable optimization by setting cacheColorHint as so - android:cacheColorHint="#00000000" in my layout xml file. Thanks!
Rob
+1  A: 

I think I once experienced this problem a while ago.

I think it might be something to do with the following two tags in the listview's layout xml file.

android:background="#FFFFFF"
android:cacheColorHint="#FFFFFF"

I rekon they're probably set to different colours in your file? (or missing). Try making them the same colour and see if it still does it. Plus, I rekon that if you had enough rows that the list view overflowed the screen, it would go black like you describe when you scrolled.

This is a bit of a long-shot, but I hope it helps.

bdls
Thanks for your reply. This was indeed the solution that was offered in Andreas' link.
Rob
Oops, I didn't mean to repeat an answer. Glad you've solved it.
bdls