ios - UICollectionView is nested in UITableViewCell and I hope the height of the former changes according to the height of the latter
phpcn_u1582
phpcn_u1582 2017-05-16 13:19:36
0
3
734
The layout method in

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?

phpcn_u1582
phpcn_u1582

reply all(3)
过去多啦不再A梦

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.

漂亮男人

UICollectionView的高度、UITableViewCell height?
Is it possible that the question was asked wrongly, and I didn’t understand the scene selection expressed by the poster?

巴扎黑

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!