开发者

How to apply background color to listview dynamically in Android?

How to apply background color to listview dynamically in Androi开发者_开发问答d?


I'm not sure what it is you want to do but one of View.setBackgroundColor(), View.setBackgroundDrawable() or View.setBackgroundResource should cover it, depending on what you want to show.

Remember, each item in a ListView is a View in its own right, so depending on how you're creating them, they may be obscuring the background you're setting for your ListView.

You may also need to disable the cache color hint to get your views to display how you want. Have a look at this post of the Android Developer's Blog for more information.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜