gpt4 book ai didi

iOS:快速向 UICollectionView 添加一个不可见的行

转载 作者:行者123 更新时间:2023-11-28 08:51:43 25 4
gpt4 key购买 nike

我有以下情况:

我正在开发一款玩家可以加入群组的游戏,它有一个 View 列出了玩家当前加入的所有群组。按照设计,组列表位于屏幕底部的按钮面板下。

我已上传图片说明情况 right here ,因为我还不能上传图片。

我的 Collection View 的提要是一个数组,包含所有组

func collectionView(collectionView: UICollectionView,
cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("GroupCell", forIndexPath: indexPath) as! GroupCell
var list = groupArray

cell.setButtonTitle(list[indexPath.row].groupName)

// Give the button a tag so it can be identified later, in prepareForSegue
cell.button.tag = indexPath.row
cell.button.addTarget(self, action: "toGroupPage:", forControlEvents: .TouchUpInside)

return cell;
}
所以我的问题是:

有没有办法在我的收藏 View 中添加底行,这样“真实”按钮就不会落在我的面板后面而变得不可点击?我尝试将三个空条目添加到我的 groupArray,但无济于事,因为它弄乱了整个 Collection View 。有没有办法做到这一点?

最佳答案

您可以在 Collection View 上设置 contentInset 属性。将底部值设置为您需要使用的任何间距。

关于iOS:快速向 UICollectionView 添加一个不可见的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34009135/

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