UICollectionView is displayed higher than in storyboard

I have a UICollectionView in a storyboard (iPad). I don't set any properties (margins, sizes, etc.) Programmatically - my delegate only implements the required methods (number of sections and items, cellForItemAtIndexPath). I am using the standard flow layout, with horizontal scrolling (1 line) and no top / bottom insertion. I have my own cell class, but again, nothing fancy (just IBOutlets for some labels and imageView). My cells are 100x100px. The CollectionView is 100px high and IB shows it as such.

attributes inspectorsize inspector

However, when I run the application, I get a collectionView rendered with a height of 140px (with a 20px mark above and below the cells). I played with different values ​​for all properties (including minimum spacing) but couldn't make it look shorter - I can make it look higher by changing the inserts.

Is this a bug or am I missing some logic that I cannot get around, for example. would a standard layout include some minimum spacing above and below its content?

+3


source to share


1 answer


The solution for me was to disable "customize scroll inserts" on a view controller that has a collection view.



0


source







All Articles