Nolan Ranolin
Nolan Ranolin

Reputation: 409

Make uiCollectionView scrollable when not full

I want my CollectionView to still be able to scroll a bit up and down when there’s only a few cells (to get that bounce effect). In a previous question it was suggested that using

self.collectionview?.alwaysBounceVerticle = true 

would work (this was marked as the correct answer) but this doesn’t work anymore.

I’m using swift 3

Upvotes: 4

Views: 2710

Answers (3)

Lucas Chwe
Lucas Chwe

Reputation: 2778

// swift
self.collectionview?.alwaysBounceVertical = true
self.collectionview?.bounces = true

Upvotes: 5

Vlad Khambir
Vlad Khambir

Reputation: 4383

You can configure it using Storyboard. Just select your collection view and in attribute inspector check * Bounces* and Bounce Vertically.

enter image description here

Upvotes: 5

Nolan Ranolin
Nolan Ranolin

Reputation: 409

After looking tying some stuff in the interface builder it turns out that you have to check the box for “Bounces” and “Bounces Vertically”

Upvotes: 6

Related Questions