Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable horizontal scrolling in UICollectionView

How do I disable horizontal scrolling in UICollectionView? I tried to add this:

self.scrollDirection = UICollectionViewScrollDirectionVertical;

to UICollectionViewFlowLayout but it didn't work. I want to have only vertical scrolling. I'm not using Interface builder.

like image 799
KlimczakM Avatar asked Oct 20 '22 18:10

KlimczakM


1 Answers

If you are using Storyboard, I believe you may set it from the Attributes Inspector. See the screen shot Below:-

UICollectionView Attributes Inspector

like image 139
Ricky Avatar answered Oct 30 '22 18:10

Ricky