OGeek|极客世界-中国程序员成长平台

标题: ios - 为什么 autosize collectionview 单元格不起作用? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 22:17
标题: ios - 为什么 autosize collectionview 单元格不起作用?

据我所知,如果您将 collectionviewlayoutestimatedItemSize 设置为非零值,则会开始自动调整大小,但它对我不起作用.

您可以获得工作副本here如果你想玩它。



Best Answer-推荐答案


我假设您已经了解 systemLayoutSizeFitting?

我认为这已经得到了回答。看看Daniel Galasko的答案,在这里:

UICollectionView Self Sizing Cells with Auto Layout

在他的回答中,他甚至引用了一个他放在一起的 GitHub 项目,你可以下载和玩:

https://github.com/danielgalasko/DGSelfSizingCollectionViewCells/tree/master

关于ios - 为什么 autosize collectionview 单元格不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54869139/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4