如何RecyclerView使用中心对待所有项目FlexboxLayoutManager?我需要像这样集中的项目:
我设置布局管理器的代码:
val layoutManager = FlexboxLayoutManager(this)
layoutManager.setFlexWrap(FlexWrap.WRAP)
layoutManager.setFlexDirection(FlexDirection.ROW)
layoutManager.setJustifyContent(JustifyContent.FLEX_START)
layoutManager.setAlignItems(AlignItems.FLEX_START)
val adapter = TagAdapter(tags)
tagRecyclerView.adapter = adapter
tagRecyclerView.layoutManager = layoutManager
Run Code Online (Sandbox Code Playgroud)
(我试图设置layoutManager.setAlignItems(AlignItems.FLEX_START)layoutManager.setAlignItems(AlignItems.CENTER)然而它没有用...
android android-layout android-recyclerview android-flexboxlayout