【发布时间】:2017-01-11 11:23:20
【问题描述】:
【问题讨论】:
-
在谷歌上搜索
StaggeredGridView -
谢谢,我对 StaggeredGridLayoutManager 有所了解,但它们以水平或垂直方式添加视图,在我的情况下,水平和垂直视图大小不同
标签: android android-layout gridview android-recyclerview
【问题讨论】:
StaggeredGridView
标签: android android-layout gridview android-recyclerview
为此,请使用RecylerView 和StaggeredGridLayoutManager
recyclerView = findViewById(R.id.recycler_view);
mAdapter = new YourAdapter(yourParameters);
recyclerView.setLayoutManager(
new StaggeredGridLayoutManager(spanCount /*in your case number of columns*/, StaggeredGridLayoutManager.VERTICAL /*orientation*/));
recyclerView.setAdapter(mAdapter);
【讨论】:
LayoutManager 支持这种行为,但您可能会找到这样做的第三方