Best way to implement header over a RecyclerView using a grid layout?

后端 未结 3 1087
醉梦人生
醉梦人生 2021-01-05 01:49

I\'m trying to implement the below image. My first thought was to have everything above the grid layout be the first row of the grid and use SpanSizeLookup to set the span s

3条回答
  •  离开以前
    2021-01-05 02:15

    • use StaggeredGridLayoutManager
    • use a different layout for your first item (the whole complex view)
    • get its layout params and setFullSpan

    This makes the item as wide as the RecyclerView itself (similar to match_parent).

    Set various click listeners in the specific ViewHolder that's responsible for this item. Using this approach would set the whole complex view to behave (scroll) as part of the RecyclerView while still making it available for (input) events.

提交回复
热议问题