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?
过去多啦不再A梦2017-05-16 13:21:36
If you want to automatically calculate the tableview cell height, it is difficult to do it.
You can first calculate the overall height of the collectionView, and then update the tableview cell height.
For smoothness, the height can be cached.
漂亮男人2017-05-16 13:21:36
UICollectionView
的高度、UITableViewCell
height?
Is it possible that the question was asked wrongly, and I didn’t understand the scene selection expressed by the poster?
巴扎黑2017-05-16 13:21:36
Write a cgfloat attribute in the tableview to record the height of the collectionview, and assign the value in the heightForRow method in the controller. It should be fine