Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make the UICollectionView scrollable even when its not full

The UICollectionView disables scrolling by default when there is not enough cells in the view. When this occurs I need it to bounce back to position when pulled. Im am aware of a hack where I can fill the UICollectionView with empty tables to enable scrolling but I was hoping there would be a slightly more fluid example as

I don't want the view to scroll but instead to automatically bounce back to its position. This is because of the effect I have implemented below as can see below.

https://youtu.be/r75xB9-Mb4g

Is there a way to achieve this simply, when there is not enough cells in the UICollectionView the scroll is disabled.

like image 256
memyselfandmyiphone Avatar asked Mar 25 '15 10:03

memyselfandmyiphone


1 Answers

Try this :

self.collectionView.alwaysBounceVertical = YES;
like image 146
Vaibhav Jhaveri Avatar answered Sep 30 '22 04:09

Vaibhav Jhaveri