You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example if you scroll horizontal gallery to left or right and scroll the whole view to down, and back scroll to top again the horizontal gallery back to zero offset.
ArticleExampleViewController, AnimatorExampleViewController and others do the same!
Is there a way for the scroll views (horizontal & vertical) in the HorizontalGalleryViewController to keep their scroll position?
The text was updated successfully, but these errors were encountered:
if you keep the view in memory then it won’t lose its scroll position. Otherwise you can use scrollViewDidScroll to keep track of the contentOffset for each collectionView
Thanks. So the CollectionKit doesn’t have any options or settings for keeping scroll position?
How can i use scrollViewDidScroll to keep position? Sorry I’m noob!
Yes, you have to implement it your self.
The easiest way is to keep everything in memory and not destroy them.
Another option is, for each collectionView, assign a UIScrollViewDelegate. When scrollViewDidScroll is called, record the contentOffset and send it to your view controller. Use a dictionary in your view controller to track all the contentOffset for each collectionView. and when creating each collectionView, pass the recorded contentOffset on the first reloadData call.
In the example if you scroll horizontal gallery to left or right and scroll the whole view to down, and back scroll to top again the horizontal gallery back to zero offset.
ArticleExampleViewController
,AnimatorExampleViewController
and others do the same!Is there a way for the scroll views (horizontal & vertical) in the
HorizontalGalleryViewController
to keep their scroll position?The text was updated successfully, but these errors were encountered: