I have an Activity with a ListView, I set the background image to the view programatically. When I scroll down my list, the background image turns to white ( because my theme is Theme.Light.NoTitleBar).
Normal ListView
Scrolling ListView
Pressing ListView item
在ListView标记上添加一个属性
android:cacheColorHint="#00000000"// setting as a transparent color
android:cacheColorHint="#000000"
in ListView
Tag Regarding make TextView's
color black or white, you can refer here to make a custom TextView
for your ListView
row, The extra work you have to do is just add another attribut inside TextView
tag like this
android:textColor="#FFF" //or #FFFFFF for white
This is due because of an optimization. To remove this, just set the cacheColorHint of your listView to transparent, like this: android:cacheColorHint="#00000000"
Full post here: http://android-developers.blogspot.fr/2009/01/why-is-my-list-black-android.html
You can Wrap that ListView inside on LinearLayout having same background and then remove ListView 's Background that should work fine. :)
Please check this answer. I have got the same issue and it is fixed by putting view = null in adapter side.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.