如何使GridLayoutManager使用动态空间? [英] How to make GridLayoutManager use dynamic spaces?

查看:64
本文介绍了如何使GridLayoutManager使用动态空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为RecyclerView使用GridLayoutManager,它显示不同文章的预览,这些文章具有不同的文本长度以及因此不同的项目高度.问题是,我该如何使用整个高度并且没有太多的间距?

I am currently using a GridLayoutManager for a RecyclerView which displays Previews of different Articles, which have different text lengths and therefor different item heights. The question is, how can I use the full height and dont have too much spacing?

推荐答案

使用StaggeredGridLayoutManager! https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager

Use StaggeredGridLayoutManager! https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager

这篇关于如何使GridLayoutManager使用动态空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆