问题
I want to achieve something like this:
But here's what I get after trying:
I already set the height of the layout of the items to WRAP_CONTENT but the result is still the same.
What should I do?
回答1:
For those who are looking for an answer, just use a StaggeredGridLayoutManager
as the RecyclerView
's layout manager like this:
recycler.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
来源:https://stackoverflow.com/questions/33316293/how-to-make-the-sizes-of-every-item-in-a-recyclerview-different