1

I want to create collection view cells the width of which changes according to the label in them. The labels of the cells get their text value from an array declared by me. Is there a way to create auto resizable collection view cells which change their length accordingly without using custom classes or pod files?

NoName555
  • 235
  • 1
  • 3
  • 8

1 Answers1

0

Try experimenting with UIStackView. I'm pretty sure the elements can be auto justified. You'll likely be able create the layout you want with vertical and horizontal stack views.

If you select multiple views in the interface builder that are arranged horizontally or vertically you can embed them in a stack view.

Embed button

if you multi select the views you want and press that button in the lower right corner of interface builder you should have an option to embed the views in a UIStack View

user3589502
  • 51
  • 1
  • 1
  • 3