如何使用recyclerview实现水平gridlayoutmanager。
固定行数。和水平滚动。
像这样...
gridLayoutManager = new GridLayoutManager(getContext(), 1, GridLayoutManager.HORIZONTAL, false);
recyclerView.setLayoutManager(gridLayoutManager);
recyclerView.setHasFixedSize(true);
我尝试这样做。但这并没有在项目中显示任何内容。
最佳答案
RecyclerAdapter
,设置其适配器。GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), ROWSCOUNT, GridLayoutManager.HORIZONTAL, false);
recyclerView.setLayoutManager(gridLayoutManager);
setContentView(recyclerView);
I've prepared a sample for you, check it out
关于android - 如何实现水平网格布局管理器,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33863174/