UICollectionView doesn't bounce when datasource has only 1 item UICollectionView doesn't bounce when datasource has only 1 item ios ios

UICollectionView doesn't bounce when datasource has only 1 item


UICollectionView has the properties alwaysBounceHorizontal and alwaysBounceVertical. Setting the horizontal to YES did the trick.


Thanks for @VaporwareWolf ,the answer is correct. I want to add a supplement that:

DO NOT forget setting the bounces property to YES at the same time(through storyboard or your code).