Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionView not able to scroll to see the entire last row

I have a UICollectionView with size: 768x1024 with a navbar on top. My custom UICollectionViewCells are of size 200x200. The problem is that when I keep adding cells and I reach the bottom row, I can only see part of the 200x200 cell. It won't let me scroll further before it bounces back up. Any ideas on what the problem could be?

EDIT:

I add cells via:

insertItemsAtIndexPaths:

like image 784
Carpetfizz Avatar asked Jan 11 '14 19:01

Carpetfizz


2 Answers

The issue was just adding AutoLayout constraints to the View Controller which housed the UICollectionView. To do this, select the View Controller in Storyboards and click on "Editor" on the top. Then, "Resolve Autolayout Issues" > "Reset to Suggested Constraints..."

like image 159
Carpetfizz Avatar answered Sep 27 '22 22:09

Carpetfizz


Check whether you have changed the minimum spacing attribute of collection view in size inspector of collection view. Setting it back to default values(10) was the solution for me.

like image 39
Wimukthi Rajapaksha Avatar answered Sep 27 '22 21:09

Wimukthi Rajapaksha