Wrong top inset when adding header to collectionView
foffer opened this issue · 0 comments
Please refer to this SO question to see the issue http://stackoverflow.com/questions/41570814/gap-between-headerview-and-collectionview
I believe this to be a bug, since I have not asked the CollectionView to apply section insets. If I implement the insetForSectionAtIndex
delegate method, nothing happens. Let me know if I can provide further code or explanation to help.
I think the erroneous code is around here: https://github.com/chiahsien/CHTCollectionViewWaterfallLayout/blob/develop/CHTCollectionViewWaterfallLayout.swift#L227
If i print(top)
and run my app, it will cycle between returning 414 and 0.
Update
I believe I have found the bug. For some reason this line here https://github.com/chiahsien/CHTCollectionViewWaterfallLayout/blob/develop/CHTCollectionViewWaterfallLayout.swift#L225 was set to maxX and not Y. Dunno why this has happened, but I figured it out now :)