Dynamically change the number of columns of a GridLayoutManager

后端 未结 3 1971
粉色の甜心
粉色の甜心 2021-02-07 04:06

I am actually using a GridLayoutManager with two columns in my app and I would like to have one column depending on the view type used.

Here is the code I have in the me

3条回答
  •  粉色の甜心
    2021-02-07 04:55

    If I understand your question, you would like to let premium-type Views span 2 columns instead of 1? That's possible by setting a custom SpanSizeLookup with setSpanSizeLookup(SpanSizeLookup).

提交回复
热议问题