我想创建一个两列的 listView,其中包含不同高度的项目,如下所示: image
我试过这个custom class在 GitHub 上找到,它很完美,但我有不同的问题,因为这个类可能是旧的(最后更新:2014):
- 带有 onClickListener 的子项的图像阻止自定义 listView 的滚动
- SwipeRefreshLayout 在向上滚动时总是出现(我只希望在列表顶部时出现)
[编辑]解决方案:
Proposed by Piyush: StaggeredGridLayoutManager with RecyclerView
最佳答案
您可以使用StaggeredGridLayoutManager
你可以使用 StaggeredGridLayoutManager
private StaggeredGridLayoutManager gaggeredGridLayoutManager;
gaggeredGridLayoutManager = new StaggeredGridLayoutManager(2, 1);
recyclerView.setLayoutManager(gaggeredGridLayoutManager);
有关更多信息,请点击此链接 StaggeredGridLayoutManager
关于android - 具有不同高度项目的两列 ListView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44628783/