uicollectionview中的UIImageView设置图像未在模拟器中显示

时间:2020-02-27 22:32:25

标签: uicollectionviewcell

我有带有默认flowLayout的UICollectionView,可以水平滚动。 单元格中只有一个UIImageView。我使用自动布局锚点将其顶部,尾部,底部和前导锚与单元格contentView对齐。

但是,在DataSource委托方法func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath)中,当我尝试将图像添加到UIImageView时,它没有显示。当我检查UIImageView时,可以看到图像。 enter image description here

0 个答案:

没有答案