Android Custom ListView Background
Android ListView is a very common control in Android development, when doing UI design, many people want to be able to change its background to achieve better visual effect, change its background is actually very simple, we just have to prepare a picture and then specify the properties of Android: background= "@drawable/bg", but don't be happy too early, when you do this, you find that the background is changed, but when you drag or click on the list blank position, the ListItem becomes black, as shown in:
What is this for?
This to start with the ListView effect, the default ListItem background is transparent, and the ListView background is fixed, so in the process of scrolling through the scroll bar if the current display of each item is mixed with the background, So the Android system in order to optimize the process, using a property called Android:cachecolorhint , under the black theme of the default color value is #191919, so there is just the picture, half is black.
What about that?
If you just change the color of the background, you can directly specify android:cachecolorhint as the color you want, if you are using a picture to do the background, it will be as long as the android:cachecolorhint Specified as transparent (#00000000) is possible, of course, in order to beautify is to sacrifice a little efficiency. The final beautification effect
"Wheat Academy" Android Development tutorial custom ListView Background