0

I want to change the height of a UICollectionViewCell depending on the size of the content that will be in the cell.

So like for example this is what it looks like now:

At the moment the cell is set to a height of:

let height = view.frame.height/1.5

but i want it to change depending on what is in the cell so if there is no picture the cell shoud be alot shorter and if there is a caption depending the length of the caption the cell height need to change to accomodate the whole caption

enter image description here

How would i go about doing this?

Gino Sesia
  • 383
  • 2
  • 4
  • 14
  • Does this answer your question? [UICollectionView Self Sizing Cells with Auto Layout](https://stackoverflow.com/questions/25895311/uicollectionview-self-sizing-cells-with-auto-layout) – Sander Saelmans Oct 09 '20 at 14:06
  • It probably dies but I don't understand how to implement it – Gino Sesia Oct 09 '20 at 17:50

0 Answers0