gpt4 book ai didi

ios - Collection View 不滚动?

转载 作者:行者123 更新时间:2023-11-30 13:14:14 24 4
gpt4 key购买 nike

我不太确定我做错了什么。我有一个动态填充的 Collection View 。用户输入电影标题,我查询 omdb 并将生成的 json 解析为单元格。问题是该 View 不允许我滚动以查看屏幕外的单元格。这是一个屏幕截图: enter image description here

这是 Storyboard片段: enter image description here

编辑1:

enter image description here

限制:

最佳答案

请尝试这个

int numberOfRows = self.dataArray.count / 2;
self.collectionView.contentSize = CGSizeMake(self.view.frame.size.width, (numberOfRows * heightOfCell));

其中 dataArray 是项目列表。

关于ios - Collection View 不滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38417832/

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