我在UIViewController中嵌入了一个UICollectionView,并尝试使用以下代码将UIRefreshControl添加到UICollectionView中:
override func viewDidLoad() {
......
// Create the UIRefreshControl.
let pullDownLogo = UIRefreshControl()
pullDownLogo.clipsToBounds = true
// Create a UIImageView.
let pullDownImgView = UIImageView(frame: pullDownLogo.bounds)
pullDownImgView.image = UIImage(named: "fa-heart")
pullDownImgView.contentMode = UIViewContentMode.ScaleAspectFit
pullDownImgView.clipsToBounds = true
// Add the UIImageView into UIRefreshControl.
pullDownLogo.addSubview(pullDownImgView)
WatchListCollectionView.addSubview(pullDownLogo)
......
}
当我拉下收集视图但未到达底部时,图像确实显示出来 问题是:图像重叠并阻塞了collectionView单元格 我想要的是刷新控制器中的图像被单元格内容阻止。
问题显示在此快照中: