我有一个CollectionView
,其单元格是BubbleNode: ASCellNode
.
我使用翠鸟作为我的主要ImageDownloader
和ImageCache
. 我有一个 imageView,我将它包裹在一个ASDisplayNode
with 中initWithViewBlock:
。
init() {
// ...
imageNode = ASDisplayNode(viewBlock: {
let imageView = UIImageView()
imageView.kf_setImageWithURL(url, placeholderImage: nil, optionsInfo: [KingfisherOptionsInfoItem.CacheMemoryOnly], progressBlock: nil, completionHandler: nil)
imageView.clipsToBounds = true
imageView.layer.cornerRadius = 12
imageView.backgroundColor = UIColor.redColor()
return imageView
})
addSubnode(imageNode)
// ...
}
第一次,图像下载并正确显示,但滚动和重新显示后,图像消失了,只显示背景颜色。
重点是当我点击矩形时,它会显示图像!