- Get link
- Other Apps
UICollectionView inside a UITableViewCell — dynamic height?
Given the following structure:
- TableView
- TableViewCell
- CollectionView
- CollectionViewCell
- CollectionViewCell
- CollectionViewCell
- [...variable number of cells or different cell sizes]
The solution is to tell auto layout to compute first the collectionViewCell sizes, then the collection view contentSize, and use it as the size of your cell. This is the UIView method that "does the magic":
-(void)systemLayoutSizeFittingSize:(CGSize)targetSize withHorizontalFittingPriority:(UILayoutPriority)horizontalFittingPriority verticalFittingPriority:(UILayoutPriority)verticalFittingPriority
Full code is available here to download.
Thanks to this awesome answer.
Thanks for sharing. All you proportion with us is up to date and quite informative; I would really like to bookmark the page so I can come here again to read you, as you've got finished a first rate job. I’ve the enjoy with one provider custom dissertation writing provider , it's miles very proper and beneficial to writing enhancing and formatting essay report also offers completely unique enjoy of essay writing for the scholars.
ReplyDeleteweb link