开发者

android how to put heading for an BaseAdpater

I wanna to put heading for an BaseAdapter. like

android how to put heading for an BaseAdpater

attached screenshot

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)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜