UICollectionView doesn't bounce when datasource has only 1 item

Solution 1:

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

Solution 2:

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).