Search code examples
iosxcodeautolayoutxcode-storyboard

CollectionView cells appearing outside collectionView.


I have a collectionView laid out in the storyboard like so:

enter image description here

Note the constraint: Collection View.top = Search Bar.bottom

I don't want any of the content in the collection View above that line. However when the app runs and you scroll the collectionView, this is what happens to the cells. What could be happening here?

enter image description here


Solution

  • Probably collectionView.clipsToBounds = true