UICollectionView doesn't bounce when datasource has only 1 item

前端 未结 2 1276
谎友^
谎友^ 2021-02-06 20:39

I have a UICollectionView with a custom UICollectionViewFlowLayout. It scrolls horizontally and only shows one item at a time (full height). I have pagingEnabled = YES so that i

相关标签:
2条回答
  • 2021-02-06 21:07

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

    0 讨论(0)
  • 2021-02-06 21:20

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

    0 讨论(0)
提交回复
热议问题