BouncyLayout
BouncyLayout copied to clipboard
Does not respect Header Views
Hi, thanks for a great and very simple to implement feature. I have only one issue - I wish the have sections yet the section headers are not being respected.
With the following line implemented:
self.collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
The CollectionView does not show my custom header view for each section.
Without that line, the header is displayed fine.
Any thoughts or suggestions? Kind regards
🤔 I will look into this.
+1
+1
Hi all, has anyone found a solution to this?
I'm running into the same Problem. Has anyone found a solution yet?
Thanks for the repo.
I also found this issue.
After gives the header a size, layout.headerReferenceSize = CGSize(width: UIScreen.main.bounds.width, height: 90)
, the header shows.
but the header's content like labels will disappear after scroll to bottom with a bouncy.
the protocol viewForSupplementaryElementOfKind
did not callback
Lately I set the layout.sectionHeadersPinToVisibleBounds = true
makes it keep showing, no idea is it has some side effects.
+1 I also see this issue and in my app the first item after the header renders invisible when I use this layout. It is fine when I do not.
Is this library being supported anymore? I sure would like to use it :-)
Yes it is @David-Pyxis-Designs I'll have a look at this issue asap! ✌️
Thanks @roberthein
This solves the issue by not applying animations when a header in in the visible rect:
open override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { let items = animator.items(in: rect) as? [UICollectionViewLayoutAttributes] if (items?.filter({$0.representedElementKind == UICollectionElementKindSectionHeader}).count)! > 0 { return super.layoutAttributesForElements(in: rect) } return items }
Not ideal but visually it is not all that bad Would love the REAL solution though
EDIT: After more testing the issue is still happening sometimes .. .depending on scroll speed it seems
@roberthein have you had a chance to look into this?