2016-07-05 6 views
0

Listテーブル項目を渡してから、これを実行して、各セルの最後の画像を含む画像ビューを生成しています。異なるセルでの画像の取得方法は次のとおりです。 -異なる画像を持つ各セルの画像ビューを設定する方法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に割り当てられます。

tableitems[UIImage]()

であると仮定し cell.imageView.image = tableitems[indexPath.row]をやってみ
関連する問題