2016-07-05 58 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]()

相关问题