如何根据行数调整UICollectionview的大小?

问题描述 投票:-4回答:1

我想根据集合中的行数来调整我的UICollectionview的大小,我不想滚动视图,它会基于行来增加其大小。

这里是我的SS,this my App SS

我引用了所有链接:-myLink1-myLink2-myLink3

我想要这样的视图:I want my CollectionView like this SS

请帮助,我是iOS新手

ios swift xcode swift4.2
1个回答
-1
投票

覆盖collectionView控制器中的内容大小

override contentSize {
    didSet {
// this called whenever the content size changes.
// change the collectionView height or width based on content size.
}
}
© www.soinside.com 2019 - 2024. All rights reserved.