6

This is my first post, so please be considerate of any mistakes or lack of clarity:)

I need to show image thumbnails (in a grid/table like layout) categorized by dates, following is an illustration* of the way it has to be shown.


Date:30 Apr 2012

Image1 Image2 Image3

Image4 Image5 Image6

Date:1st May 2012

Image1 Image2 Image3

Image4 Image5

Date:1st May 2012

Image1 Image2


Based on all the looking around that I have done, I haven't found no straight forward way to do it. Following are two possible layouts that come closer, but each has some problems

  • GridView, don't know how can I add date/group headers in between the content, as column span is not possible.
  • TableLayout, though columnspan is possible but I am not sure if the desired layout can be achieved. And I read that whenever the orientation changes or app runs on a different devices, the number of rows and columns have to be computed (which is not so in grid). And what I have gathered, in TableLayout extra work needs to be done for cell level events.

An important consideration is that around 4000 thumbnails will be shown.

I have gone through some posts on stackoverflow, but none is talking about the kind of layout listed above, for example the following question is same but the answer is providing grouping in a ListView rather than grid/table like layout

Link: Android GridView with categories?

Please provide some ideas. Thanks.

**As I am new user so can not upload images, hence the textual illustration, kindly bear.*

4

3 回答 3

0

也许StickyGridHeaders 库将是一个很好的解决方案。它将帮助您制作带有类别的网格视图。

于 2014-09-27T14:21:17.670 回答
0

您可以使用scroll view with a linear layout方向是垂直的。有两个独立的布局一个有Textview to be the header text另一个layout containing three image views。只需在运行时将这两个布局添加到滚动视图中即可。

于 2012-11-20T09:35:40.280 回答
0

为此,您将需要两个嵌套布局。您可能希望 ScrollView 用于顶层,并在此 ScrollView 内部为每个类别的图像设置一个 GridView。

于 2012-12-20T20:45:37.453 回答