这是我的UICollectionViewCompositionalLayout代码。
我想实现的是集合视图单元格应该根据单元格中的内容自动调整大小。一旦我刷新集合视图,我就得到了视频中所示的问题。
https://drive.google.com/file/d/1jVaFWT6cV8FzBqOF_1HRxzXUBYpPYyTh/view?usp=share_link
我试过使用这几种解决方案,但仍然没有希望。
https://developer.apple.com/forums/thread/663938UICollectionViewCompositionalLayout horizontal, not calculating width of content when using estimated and not horizontally huggingUICollectionView Compositional Layout - items size not updated properly on iPad rotationUICollectionViewCell content wrong size on first load
1条答案
按热度按时间thtygnil1#
为了构建标签列表,我使用了这个小lib:AlignedCollectionViewFlowLayout
您可以在GitHub上打开存储库,仅复制源文件,并在项目中使用它以便于自定义。