每当我滚动时ListView重绘背景颜色

She*_*lam 3 android listview themes

我已经定义了一个自定义主题,我在窗口背景上绘制了一个黑色渐变.我的ListView背景设置为透明,但每当我滚动时,背景颜色变为黑色,然后滚动停止后,返回渐变颜色.为什么是这样?

<?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>
Run Code Online (Sandbox Code Playgroud)

mre*_*elt 11

您的问题在这里得到解答:http://developer.android.com/resources/articles/listview-backgrounds.html 您只需要设置cacheColorHint以解决您的问题.:-)