My browsing of the collection starts life short, at the bottom of the screen the view of the controller opens. When the user scrolls a bit, I would like the collection to fill the view. I would like it to shrink again when the user descends into the bounce area.
Here is the code I would like to do (and I think it should work):
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { if (scrollView == self.collectionView) { CGFloat offsetY = self.collectionView.contentOffset.y; if (offsetY > 20.0) { [self setCollectionViewExpanded:YES]; } else if (offsetY < -10.0) { [self setCollectionViewExpanded:NO]; } } } - (void)setCollectionViewExpanded:(BOOL)expanded {
But after the multiplication occurs, the cells remain in the same position relative to the parent view (still near the bottom), and the collection view stops responding to panning calls and no longer sends scrolling notifications.
I can load the contents correctly by doing reloadData in the animation completion block, but the scroll bars stop working anyway.
A back, I tried something like this with a table view (or some other kind of scroll) and ran into a similar hang. It is very important if anyone decides ...
source share