Open lutao2599 opened 3 years ago
使用GroupedGridLayoutManager,复写getChildSpanSize方法。当某个组想要线性布局时,getChildSpanSize就返回spanCount,item就会占满一行。
可参考我的demo中的Grid2Activity页面。
感谢您的耐心解答,解决了我的问题,但是有点疑问:就是groupPosition=0要一行显示,等于1的时候要使用网格,但是要反过来赋值才达到我想要的效果,请问怎么回事?
------------------ 原始邮件 ------------------ 发件人: "donkingliang/GroupedRecyclerViewAdapter" @.>; 发送时间: 2021年5月7日(星期五) 下午5:41 @.>; @.**@.>; 主题: Re: [donkingliang/GroupedRecyclerViewAdapter] 如何实现线性布局和网格布局同时存在 (#73)
使用GroupedGridLayoutManager,复写getChildSpanSize方法。当某个组想要线性布局时,getChildSpanSize就返回spanCount,item就会占满一行。
可参考我的demo中的Grid2Activity页面。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
请问怎么修改网格布局之间的间距
------------------ 原始邮件 ------------------ 发件人: "donkingliang/GroupedRecyclerViewAdapter" @.>; 发送时间: 2021年5月7日(星期五) 下午5:41 @.>; @.**@.>; 主题: Re: [donkingliang/GroupedRecyclerViewAdapter] 如何实现线性布局和网格布局同时存在 (#73)
使用GroupedGridLayoutManager,复写getChildSpanSize方法。当某个组想要线性布局时,getChildSpanSize就返回spanCount,item就会占满一行。
可参考我的demo中的Grid2Activity页面。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
1、给item布局的margin设置间隔。 2、参考我demo中的自定义CustomGridItemDecoration。需要间隔的item,对应的getxxxSize方法返回间隔大小,不需要则返回0。Drawable可以返回null。
谢谢大佬
------------------ 原始邮件 ------------------ 发件人: "donkingliang/GroupedRecyclerViewAdapter" @.>; 发送时间: 2021年5月8日(星期六) 上午9:54 @.>; @.**@.>; 主题: Re: [donkingliang/GroupedRecyclerViewAdapter] 如何实现线性布局和网格布局同时存在 (#73)
1、给item布局的margin设置间隔。 2、参考我demo中的自定义CustomGridItemDecoration。需要间隔的item,对应的getxxxSize方法返回间隔大小,不需要则返回0。Drawable可以返回null。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
demo中没有这个类
------------------ 原始邮件 ------------------ 发件人: "donkingliang/GroupedRecyclerViewAdapter" @.>; 发送时间: 2021年5月8日(星期六) 上午9:54 @.>; @.**@.>; 主题: Re: [donkingliang/GroupedRecyclerViewAdapter] 如何实现线性布局和网格布局同时存在 (#73)
1、给item布局的margin设置间隔。 2、参考我demo中的自定义CustomGridItemDecoration。需要间隔的item,对应的getxxxSize方法返回间隔大小,不需要则返回0。Drawable可以返回null。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
我是要缩小网格布局之间的间距,该怎么操作呢
------------------ 原始邮件 ------------------ 发件人: "donkingliang/GroupedRecyclerViewAdapter" @.>; 发送时间: 2021年5月8日(星期六) 上午9:54 @.>; @.**@.>; 主题: Re: [donkingliang/GroupedRecyclerViewAdapter] 如何实现线性布局和网格布局同时存在 (#73)
1、给item布局的margin设置间隔。 2、参考我demo中的自定义CustomGridItemDecoration。需要间隔的item,对应的getxxxSize方法返回间隔大小,不需要则返回0。Drawable可以返回null。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
间距大小是可以自己设置的,getxxxSize方法返回0,就是没有间隔。
没在你的demo中找到这个类
------------------ 原始邮件 ------------------ 发件人: "donkingliang/GroupedRecyclerViewAdapter" @.>; 发送时间: 2021年5月8日(星期六) 上午9:54 @.>; @.**@.>; 主题: Re: [donkingliang/GroupedRecyclerViewAdapter] 如何实现线性布局和网格布局同时存在 (#73)
1、给item布局的margin设置间隔。 2、参考我demo中的自定义CustomGridItemDecoration。需要间隔的item,对应的getxxxSize方法返回间隔大小,不需要则返回0。Drawable可以返回null。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
如何实现首页上面是线性布局,下面是网格布局