views:

56

answers:

1

I have defined a custom theme, where I am drawing a dark gradient on my window background. My ListView background is set to be transparent, however whenever I scroll, the background color turns black, and then after scrolling has stopped, goes back to the gradient color. Why is this?

<?xml version="1.0" encoding="utf-8"?>
    <resources>
      <!-- Base application theme is the default theme. -->
      <style name="Theme" parent="android:Theme">
      </style>

      <!-- Variation on our application theme that has a translucent
     background. -->
      <style name="Theme.DarkGradient">
        <item name="android:windowBackground">@drawable/dark_gradient</item>

      </style>

    </resources>
+3  A: 

Your question is answered here: http://developer.android.com/resources/articles/listview-backgrounds.html You just need to set the cacheColorHint in order to fix your problem. :-)

mreichelt