3
I’m using Flexboxlayoutmanager to align the items, but I need all items to be aligned in the center, regardless of the amount of items (dynamically).
I want these items to stay like this:
But what I’ve done stays that way:
(I want the yo-yo to stay downtown)
How I defined the 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 doesn’t work
I tried, it didn’t work
– felipe.rce