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

  1. create uitableview
  2. create uiview separately used fixed table header
  3. setup table's tableheaderview property conform uiview's frame
  4. as uitableview inherited uiscrollview can rely on scrollviewdidscroll 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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -