Вид коллекции с ячейками, которые заполняют все пространство

#ios #swift #layout #uicollectionview

Вопрос:

Я хочу создать представление коллекции с ячейками, которые выглядят следующим образом:

То, что у меня сейчас есть, выглядит так:

I set up my collection view so that is has a vertical layout.
When i press a button I add some text to my collection and it is put inside of a cell.
Depending on the texts’ height I set each cell’s height, the width is always the same for each cell.
What I currently have is what you see in the last picture.
When multiple cells are added, they don’t fill the available space but they follow a scheme like the following:

enter image description here

В то время как я хочу, чтобы они следовали этому (каждый раз, когда есть место, оно должно быть заполнено): введите описание изображения здесь

Как я могу добиться такой компоновки?

Комментарии:

1.Я думаю, что ссылки ниже решат вашу проблему 🙂 github.com/heuristisk/hkAlium andersongusmao.medium.com/…iosapptemplates.com/blog/swift-programming /…