Android Background ListView becomes black when scrolling

This question already has an answer here:

  • Background ListView becomes black when scrolling 11 answers

  • 在ListView标签上添加一个属性

    android:cacheColorHint="#00000000" // setting as a transparent color
    

    You need to set your ListView's cache color to the same as your ListView's color:

    <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"
        android:drawSelectorOnTop="false"
        android:divider="#C8C8C8"
        android:background="#C8C8C8"
        android:cacheColorHint="#C8C8C8"  />
    

    Sidenote: If you want your divider to be invisible, you can also do this as followed:

    android:divider="@null"
    
    链接地址: http://www.djcxy.com/p/24190.html

    上一篇: 无法显示MapView

    下一篇: 滚动时Android背景ListView变黑