UICollectionView
is similar to waterfall flow, and the contentSize
of UICollectionView
is determined according to the size of the text. I hope that the height of UITableViewCell
can change according to the height of UICollectionView
. How can I do it?
如果你想做到tableview cell高度可以自动计算,是很难做到的
可以先算出collectionView的总体高度,然后更新tableview cell高度
为了流畅,可以缓存高度。
UICollectionView
的高度、UITableViewCell
的高度?是不是问题提的有错啊,而且没能明白楼主表达的场景选用。
在tableview中写一个cgfloat的属性记录collectionview的高度,在controller中的heightForRow方法中赋值应该就可以了