Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not respect Header Views #14

Open
AppDevGuy opened this issue May 5, 2017 · 11 comments
Open

Does not respect Header Views #14

AppDevGuy opened this issue May 5, 2017 · 11 comments

Comments

@AppDevGuy
Copy link

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.

ezgif com-video-to-gif

Without that line, the header is displayed fine.

ezgif com-video-to-gif 1

Any thoughts or suggestions? Kind regards

@roberthein
Copy link
Owner

🤔 I will look into this.

@oferRounds
Copy link

+1

1 similar comment
@ll9750
Copy link

ll9750 commented May 15, 2017

+1

@oferRounds
Copy link

Hi all, has anyone found a solution to this?

@magicmikek
Copy link

I'm running into the same Problem. Has anyone found a solution yet?

@LeiHao0
Copy link

LeiHao0 commented Jun 1, 2018

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.

@David-Pyxis-Designs
Copy link

David-Pyxis-Designs commented Jul 24, 2018

+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 :-)

@roberthein
Copy link
Owner

Yes it is @David-Pyxis-Designs
I'll have a look at this issue asap! ✌️

@david-koneksa
Copy link

Thanks @roberthein

@David-Pyxis-Designs
Copy link

David-Pyxis-Designs commented Aug 1, 2018

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

@conanm
Copy link

conanm commented Nov 13, 2018

@roberthein have you had a chance to look into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants