gpt4 book ai didi

objective-c - 如何将图像设置到 NSCollectionView 中?

转载 作者:行者123 更新时间:2023-12-03 16:28:18 24 4
gpt4 key购买 nike

下面是我的代码:

var  arrCategory:[NSString] =
["Australia","Austria","Belgium","Brazil","Cameroon","Canada","Chile","China","Denmark","Argentina"]

上面数组中给出的字符串是图像的名称。

最佳答案

将代码替换为:

cell.imageView?.image = UIImage(named: "\(self.arrCategory[indexPath.row]).png")
cell.LblName.text = "\(self.arrCategory[indexPath.row])"

关于objective-c - 如何将图像设置到 NSCollectionView 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45235145/

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