简体   繁体   中英

How to set Background color of expandable List in android

I have one expandable list view and i need to set background to Expandable list view.
How to set this background?

You need to set both the background color AND the cacheColorHint to the same color (black, in the example below). If you don't, the list will appear to flicker as you scroll through it, same as a regular ListView .

<ExpandableListView
    android:background="#000000"
    android:cacheColorHint="#000000"
    ... />

Also, your child views will be drawn over the ExpandableListView, so make sure you aren't setting their background colors unnecessarily.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM