Custom Grid View with Row span and Column span

前端 未结 3 1167
别那么骄傲
别那么骄傲 2021-01-05 23:14

i am trying to implement a grid view which has the Graphical view as follows. I have gone through various blogs and S.O questions, and unfortunately i am not able to provide

3条回答
  •  滥情空心
    2021-01-06 00:16

    Do you intend to repeat the pattern for your scrollable view? To be more clear, does your Grid item with large span repeat at regular intervals?

    One option would be to use a list view and implement your large span view with two normal views as one row of the list view with a tag such as "special_row" and implement regular views as another row with tag like "normal row". Based on the requirement you can recycle the rows by accessing the row tags.

    EDIT:

    I found a library that implements pinterest like UI for android. This has a symmetric views in it. Checkout PinterestLisView.

    EDIT:

    Here is another interesting technique by specifying coulmn span and row spans for the grid items. I took from this question. I guess you can do away with the static xml declaration of grid items by programmatically specifying column and row spans.

提交回复
热议问题