我有UITableView with UITableViewCell,它包含UICollectionView,如:
在UICollectionView中,数据是动态添加的。我已经订阅了UICollectionView contentSize,并且正在相应地将UICollectionView的框架更改为contentSize。它运行良好,包含UITableViewCell的UICollectionView框架正在正确变化,但UITableView contentSize不更新。我不明白为什么?
UITableView项高度设置为UITableViewAutomaticDimension
发布于 2018-10-05 22:57:43
我找到的最好的解决办法。这是手工计算高度,而不使用UITableViewAutomaticDimension。
是的,你得花点时间写这个。
在添加了UICollectionViewCell的每个元素之后,您需要更新您的tableView (取决于适合您的内容):
https://stackoverflow.com/questions/52667832
复制相似问题