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
精彩评论