Reputation: 2568
I'd like to know if it's possible to disable the "pull to refresh" space on top of a collection view, when the user reaches the top of it.
This is the normal state:
And this is when I pull it down, there is this blank space that I'd like to avoid:
Upvotes: 1
Views: 2921
Reputation: 5269
This is called bouncing.
and you can disable it either in editor
just select your CollectionView and under inspector you will find the bounces properties
disable them (or just what you want)
or programmatically
override func viewDidLoad() {
super.viewDidLoad()
collectionView.bounces = false
collectionView.alwaysBounceVertical = false
}
Upvotes: 7
Reputation: 7220
Set collectionView.bounces
and collectionView.alwaysBounceVertical
to false.
Upvotes: 2