Collection-View-in-a-Table-View-Cell icon indicating copy to clipboard operation
Collection-View-in-a-Table-View-Cell copied to clipboard

Self-sizing Cells

Open ghost opened this issue 8 years ago • 3 comments

I've recently read your great tutorial while I was looking for a solution for my problem: Let's say in each cell of the UICollectionView, a UIImageView and a UILabel are stacked in a vertical UIStackView. Since I always use Dynamic Type, the label height and thus the collectionView cell height can't be set to a constant predefined value. How can I lay out the UICollectionView in a UITableView cell so that both the tableView cell height and the collectionView item size can be determined automatically? I've played around with AutoLayout in InterfaceBuilder trying to make this work with no luck. I should say, I've been using self-sizing cells on both UITableView and UICollectionView since iOS 8 when they're not nested together without any problems whatsoever.

ghost avatar Aug 03 '17 13:08 ghost

Hey there! That's a really good question. To be honest I've not used Dynamic Type in this situation, and usually even my regular collection/table cells are static heights. I'm not sure where to do with this – leaving the issue open in case others have suggestions. Good luck!

ashfurrow avatar Aug 05 '17 15:08 ashfurrow

Hi there! Stuck with the same problem. Have you found any solution? Thank you!

AlexChekanov avatar Feb 18 '18 23:02 AlexChekanov

In the same boat with dynamic type needing dynamic collectionView cell heights. 😢

gdoublev avatar May 01 '18 15:05 gdoublev