ios - Scroll outer scrollview, then scroll the inner -


i have view looks below:

  • outer uiscrollview
    • uiimageview
    • inner uicollectionview

enter image description here

i when user scrolls, should reach end of outer scrollview , starts scrolling inner scrollview, , vice versa(when user scrolls up, reaches top of inner scrollview , starts scrolling outer view).

all neccessary smooth. smooth, mean user able start decelerating outer scrollview, , deceleration moved within innerview.

i hope clear, since not easy explain. sorry if such question exists, couldn't find same. appreciate link and/or example.

thanks in advance :)

edit: wouldn't single collection view header view, containing image, reasons, not mentioned here. wouldn't use approach, using header cell.

give outer scrollview contentsize that's equal image’s size plus collection view’s contentsize.

forbid scrolling on collectionview.

implement outer scrollview’s delegate scrollviewdidscroll method update:

  • the image’s transform(so have illusion stays still)
  • the collection view’s transform (the same)
  • the collection view’s contentoffset (so have illusion you've scroll it, , not outer scrollview).

quite bit difficult explain that, i'm in hurry, it's feasible , that's way i've done few months ago in app in production.

this has effect of "transferring" inertia outer scroll view inner collectionview, think want.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -