在 CollectionView 中设置 backgroundView 后没有出现 Refresh Controller

Refresh Controller doesn't appears after setting backgroundView in CollectionView

我不明白为什么会这样,但是当没有设置 backgroundview 时,refreshcontroller 工作完美。例如,当没有任何数据时,我将 collectionview backgroundview 设置为 emptyBackgroudnview。它在 tableview 中工作得很好。但在 collectionview 中它不起作用。我尝试使用 self.refreshControl.layer.zPosition = (self.collectionView.backgroundView?.layer.zPosition)! + 1; 添加 zPosition 但它没有帮助。如果设置了背景视图,我无法向下滑动。

找到解决方案。刚刚添加的 bin 已修复问题 collectionView.alwaysBounceVertical = true