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.
If you are using Storyboard, I believe you may set it from the Attributes Inspector . See the screen shot Below:-
You have to implement custom Layout for this. For Custom Layout follow this 2 Example, you can get your answer.
You can set vertical scrolling of UICollectionView from UIBuilder also...
Set the scroll direction as Vertical...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.