iphone - How to lock a view as the user scrolls -
i new-ish iphone development , trying figure out how can fix view after has reached top of screen when user scrolls window. view unlock when window scrolled down again go original position. ive seen on on few apps instagram (with user name separators).
does design pattern have specific name?
an example (not iphone though) can seen on http://mashable.com/ -- @ "the new stuff", "the next big thing", , "what's hot" bar. see how locks scroll down
my solution is
- create
uitableview
- create
uiview
separately used fixed table header - setup table's
tableheaderview
property conformuiview's
frame - as uitableview inherited
uiscrollview
can rely onscrollviewdidscroll
method in adjust fixed header y coordinate changes when scrolling table.
there can other similar solution strenght of particular solution can manipulate fixed header's gui element throughout scrolling easily.
an example better writing down details created (and others here @ so) sample project (of course quick'n dirty), can find here @ github: https://github.com/codedad/so_fixed_tableheader_ios
Comments
Post a Comment