Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

UICollectionView inside FamilyViewController has incorrect behavior. #127

Closed
superk589 opened this issue Jul 16, 2019 · 11 comments · Fixed by #128
Closed

UICollectionView inside FamilyViewController has incorrect behavior. #127

superk589 opened this issue Jul 16, 2019 · 11 comments · Fixed by #128
Labels
bug Something isn't working

Comments

@superk589
Copy link
Contributor

The view hierarchy is
FamilyViewController
--UICollectionView inside a UIViewController
--UICollectionView inside a UIViewController

They are added using
addChild(viewController, view: { $0.collectionView })

Each collectionView has 50 items retrieved from network with content size over the screen height.
image
The result is that the collectionView does not show all the items when scrolling down.
The demo project is here https://github.com/superk589/FamilyDemo
What's wrong in my implementation?

@zenangst
Copy link
Owner

@superk589 Interesting, I haven’t seen this before. I’ll have a look when life allows, on vacation with the family at the moment. (Pun not intended)

@zenangst
Copy link
Owner

@superk589 I checked out your demo project, thanks for that by the way, it really helped when debugging ❤. I'm happy to report that there is nothing wrong with your implementation, it just seems like there is a rather random rounding bug going on that needs fixing. I've made a PR to fix this here, I tried your demo with that branch and now everything is fine and dandy. A release is on its way.

Thanks for bringing this to my attention 😎

@superk589
Copy link
Contributor Author

This bug reappears in the newest version 0.20.7
image
The collection view has 50 items, but only shows the first 20 items.
See my demo here:
https://github.com/superk589/FamilyDemo

@zenangst zenangst reopened this Sep 11, 2019
@zenangst
Copy link
Owner

@superk589 hey mate, I’m gonna investigate this issue as soon as I get to the office.
I think I know what is causing this issue, a new release should be just around the corner. Cheers!

@zenangst
Copy link
Owner

Hey @superk589, would you mind trying this branch to see if that doesn't fix the issues you've been seeing: fix/rendering-issues-with-vertical-collection-views

@superk589
Copy link
Contributor Author

The bug above is fixed. Thank you. 😊
But there is another one not fixed, like this one but has more preconditions. I'll try to make another demo to reproduce it tomorrow.

@zenangst
Copy link
Owner

@superk589 awesome! Keep posting issues when you find them and I’ll do my best to smash them with my giant hammer! 🔨😎

@superk589
Copy link
Contributor Author

ezgif-4-8878a7150142
This new issue only occurs on real devices. (The device above is iOS 12.4, iPhone X)
Use demo code here(the newest commit):
https://github.com/superk589/FamilyDemo

@superk589
Copy link
Contributor Author

When a collection view with more than one screen items followed by a new collection view with fewer items, the first collection view will be jumpy.
@zenangst

@zenangst
Copy link
Owner

@superk589 could you open a new issue for this one so that we can keep track on which PR fixes what issue? :)

@superk589
Copy link
Contributor Author

@zenangst OK

@zenangst zenangst added the bug Something isn't working label Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants