我也想停止收集弹跳效果,我想拉刷新。
collectionView.alwaysBounceHorizontal = false
collectionView.alwaysBounceVertical = true
collectionView.isDirectionalLockEnabled = true
collectionView.isScrollEnabled = true
collectionView.bounces = false
如何在集合视图中启用拉动刷新而没有反弹效果?
答案 0 :(得分:0)
您可以添加UIRefreshControl并添加操作方法。
let refreshControl = UIRefreshControl()
refreshControl.tintColor = .blue
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)
collectionView.addSubview(refreshControl)
collectionView.alwaysBounceVertical = true