ios - How to create UIScrollView with different page sizes (page snapping, bounce) -
i'm trying create custom vertical uiscrollview handle multiple pages different page heights.
assumptions:
- page height equal or greater screen height
- if page taller screen height, scrolls usual uiscrollview – bouncing on top , bottom
- if user ends scrolling , "page break" in middle of screen
- if there no velocity - page snaps closest
- if there velocity - page changes 1 in direction of swipe
i've tried many approaches achieve this, i've stumbled upon many uiscrollview quirks, make hard.
problems:
- uipangesturerecognizer has unreliable method getting velocity (velocityinview:)
- scrollviewwillenddragging:withvelocity:targetcontentoffset: method gives me headache, because arbitrarily can destroy attempts animate setting content offset
- i don't know how achieve bounce in 1 of middle pages, i'm afraid have rewrite whole scrolling handling
- when try override setting content offset when uiscrollview decelerating,
- my content offset set
- deceleration continues beyond content offset set
bonus
i have tried putting uiscrollview inside uiscrollview page, approach pain in neck. example when @ bottom of inside scroll, scrolled down bit, put finger away , grabbed again , scrolled upwards, outer scroll received touch, messed inside scroll presentation.
does have idea how this? tips helpful i'm stuck...
try this. might help. based on circa news app.
Comments
Post a Comment