I'm using FlexboxLayoutManager to align items, however, I need all items to be aligned in the center, regardless of the amount of items (dynamically).
I want these items to look like this:
ButwhatIdidlookslikethis:
(I want yo-yo to stay in the center)
How do I define layoutmanager:
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
I tried to use layoutManager.setAlignItems(AlignItems.CENTER)
but it does not work