Reputation: 538
I have this problem when I created too many folders into my app.
The folders overlap on other UI elements
If instead, I scroll this what happened
I need to stop the scroll and not overlap the other elements
This is my code
func collectionView(_: UICollectionView, layout _: UICollectionViewLayout, insetForSectionAt _: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 0.0, left: 10.0, bottom: 0.0, right: 10.0)
}
func collectionView(_: UICollectionView, layout _: UICollectionViewLayout, minimumLineSpacingForSectionAt _: Int) -> CGFloat {
return 10.0
}
func collectionView(_: UICollectionView, layout _: UICollectionViewLayout, sizeForItemAt _: IndexPath) -> CGSize {
return CGSize(width: UIScreen.main.bounds.size.width, height: 70)
}
func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> Int {
return arrItems.count
}
The Constrains
You can see my constraints to the left
Thanks In advance
Upvotes: 0
Views: 306
Reputation: 36
Check the field "Clip to Bounds" in the UICollectionView
's Attribute Inspector in the "View" section.
Upvotes: 2