2016-03-10 59 views
0

我想,當我按下按鈕,插入從陣列的圖像顯示在集合視圖細胞圖像我的單元格中顯示,但我想,當我按下按鈕

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

我想從數組中插入圖像,當我按下按鈕 – user3140069

回答

0

你可以試試reloadData和然後設置圖像,或者如果它應該只對一些索引完成,你可以嘗試reloadDataForRowIndexes:columnIndexes,然後也設置圖像在選定的行

相關問題