当我按下按钮
时,我想从数组中插入图像func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath)
cell.backgroundColor = UIColor.orangeColor()
return cell
}
func buttonCreateStickerPressed(sender: UIButton!){
let stickerName = "Sticker Number "+String(stickerDictionary.count+1)
let stickerNumber = stickerDictionary.count+1
makeSticker(stickerName, stickerNumber: stickerNumber)
// let count = stickerArray.count
}
答案 0 :(得分:0)
您可以尝试reloadData然后设置图像,或者是否只应对某些索引进行处理,您可以尝试reloadDataForRowIndexes:columnIndexes,然后在所选行中设置图像