I wanna to put heading for an BaseAdapter. like
This is an android app Pulse news reader. I want to know how they made this front page. How th开发者_Go百科ey put headings for every image adapter. What the concept they used here. Plz anybody tell me with sample example. Thank you
There are two things to think about, the data and the layouts.
The list that's being displayed is an array of items where each item represents a feed. The feed represents an array of articles.
Think of the objects something like this
Feed
- Title (
String
) - Articles (
List<Article>
)
Article
- Thumbnail (
Image
) - Headline (
String
)
Your adapter is going to be bound to a List<Feed>
, and the layout file that you use to display a "Feed" item is going to have a vertical LinearLayout that displays the title and then below that a horizontal LinearLayout containing the Articles array (using layout_weight to make each item hold an equal amount of horizontal space)
精彩评论