开发者

How to set the background of the body of ListView (content part in the middle but not the header or foot)?

Here I want to separately set the background of header part and the body part of a ListView, like a rectangle with white background color and light blue bound for each.

But I cannot find the way to set the backgrou开发者_JS百科nd for the BODY part of ListView. When I call the listview.setBackgroundResource(bg), the parameter background wraps the whole of listview, I cannot just set the background of the BODY part.


This is a classic example of the power of Android's ListView. you have a case where different list items have different views (in your case the only different is the background). I recommend you to view Google I/O 2010 video about listviews mainly you need to focus around getViewType method

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜