gpt4 book ai didi

ios - collectionView 中的内容大小错误

转载 作者:行者123 更新时间:2023-11-29 05:52:42 25 4
gpt4 key购买 nike

我已经为 UICollectionView 创建了自定义布局。我已经对 preparesizeForItemAtIndexPath 方法进行了子类化。

问题是 contentSize 宽度与我的两个单元格宽度之和不对应。滚动方向为水平

最佳答案

这对我来说是工作

[self.collectionView.collectionViewLayout invalidateLayout];
[self.collectionView.collectionViewLayout prepareLayout];
[self.collectionView.collectionViewLayout layoutIfNeeded];

关于ios - collectionView 中的内容大小错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55532849/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com