How to force UICollectionView with fewer items to scroll?

泪湿孤枕 提交于 2019-12-18 12:22:42

问题


I am working with a UICollectionView that displays fewer items than necessary to fill the whole screen. With this setting, the view simply does not scroll (move and bounce), when I add like 20 items it works.

How can I force the collection view to scroll, without enough items to fill the screen?


(source: bytolution.com)

Thanks for your help!

BTW I already tried to set the contentSize (e.g. to {320 , 1000}) but it still does not work.


回答1:


Try to set alwaysBounceVertical property to YES:

self.collectionView.alwaysBounceVertical = YES;

The default value is NO



来源:https://stackoverflow.com/questions/16079624/how-to-force-uicollectionview-with-fewer-items-to-scroll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!