2016-07-05 72 views
0

我傳遞List tableitems,然後在獲取單元格我正在這樣做這是生成圖像視圖與每個單元格中的最後一個圖像。我想要所有的4獲取單元格的方法如下: -如何設置不同圖像的每個單元格的圖像視圖iOS.Xamarin

public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath) 
     { 
      UITableView cell = TableViewView.DequeueReusableCell (CardCellId) as UITableViewCell; 
    foreach(UIImage img in tableitems) 
{ 
    cell.ImageView.Image=img; 
} 
    return cell; 
} 

這裏的tableitems是我的UIImages列表。

回答

1

你每次循環播放你的數組GetCell被調用,這就是爲什麼只有最後一張圖像被分配到你的imageView

嘗試做cell.imageView.image = tableitems[indexPath.row]假設tableitems[UIImage]()

相關問題