In Android, listview is the most commonly used control. During the uidesign, many people want to change its background so that it can conform to the overall uidesign, it's easy to change the background. You only need to prepare an image and specify the property Android: Background = "@ drawable/BG". But don't be so happy. When you do this, you will find that the background has changed, however, when you drag or click the blank position in the list, it is found that all listitems are black, which damages the overall effect. The default listitem background is transparent, the background of the listview is fixed, so if the display content of each item and the background of the current item are mixed in real time during scroll of the scroll bar, therefore, the android system uses an attribute called Android: cachecolorhint to optimize this process. The default color value for the black topic is #191919, half of them are black. If you only change the background color, you can directly specify androi D: cachecolorhint indicates the color you want. If you use an image as the background, you only need to specify Android: cachecolorhint as transparent (#00000000, of course, we have to sacrifice some efficiency for beautification.
Note: QQ technology exchange group: add one if you are interested in 108614806.