ios - Two UIViews & one UICollectionView inside UIScrollView (or better approach) -


i need have ios app screen this:

screen

the idea when user start scroll down first uiview move until second uiview reach top stick , uicollectionview continue move up.

currently i'm using structure

  • uiscrollview (main scroll)
    • uiview (some banners)
    • uiview (uisegmentedcontrol)
    • uicollectionview (grid items, scroll disabled, main scroll used)

i manage it, needed set uicollectionview height constraint manually in code (calculated based on items in grid) in order appear in uiscrollview (everything else handled autolayout in storyboard). problem uicollectionview think cells visible , load them, whole recycling & reusing thing not work. it's worst because use willdisplaycell method on uicollectionview load more data when last cell displayed, load pages @ once.

my question (actually 2)

  1. how can fix issue above?
  2. what right way achieve functionality? maybe whole approach conceptually wrong?

collection view scroll view itself. maybe have same functionality collection view sections or custom layout?


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -