如何对齐RecyclerView项目。我正在使用ChipsLayoutManager,以便可以并排获取正在运行的项目,但它留有很多空间,我希望下一个项目在第一个末端继续。
代码如下:
ChipsLayoutManager chipsLayoutManager = ChipsLayoutManager.newBuilder(Quran_e_Kareem.this)
//a layoutOrientation of layout manager, could be VERTICAL OR HORIZONTAL. HORIZONTAL by default
.setOrientation(ChipsLayoutManager.HORIZONTAL)
// row strategy for views in completed row, could be STRATEGY_DEFAULT, STRATEGY_FILL_VIEW,
//STRATEGY_FILL_SPACE or STRATEGY_CENTER
.setRowStrategy(ChipsLayoutManager.STRATEGY_DEFAULT)
// whether strategy is applied to last row. FALSE by default
.build();
listView.setLayoutManager(chipsLayoutManager);
感谢您的帮助。
答案 0 :(得分:0)
这将为您提供帮助
ChipsLayoutManager chipsLayoutManager = ChipsLayoutManager.newBuilder(this)
.setOrientation(ChipsLayoutManager.HORIZONTAL)
.build();