How to force UICollectionView with fewer items to

2019-02-04 19:33发布

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?

http://bytolution.com/Screenshot%202013.04.17%2021.57.00.png

Thanks for your help!

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

1条回答
何必那么认真
2楼-- · 2019-02-04 19:44

Try to set alwaysBounceVertical property to YES:

self.collectionView.alwaysBounceVertical = YES;

The default value is NO

查看更多
登录 后发表回答