objective c - Custom Scrollbar for iPhone's UIView (Making Long Scrolls Not Suck) -


in post, making long scrolls on iphone not suck, aza raskin describes alternative scrollbar control that's better @ getting around on long pages:

sticky scroll indicator

it's not important scrollbar "remains amount of time" activate it; i'm fine swiping along right edge of iphone's screen grab hold of scrollbar handle. idea if drag handle 3/4 of way down on physical screen, i'd 3/4 of way down on page.

tthe dropbox iphone app (it's great, btw!) has kind of scrollbar long pdf documents. regular scrolling done dragging anywhere on handle; dragging handle moves view location. seems have been implemented "from scratch", don't think sdk flexible enough customize behavior of existing scrollbar.

however, dropbox uses native document viewers show documents on iphone, somehow add scrollbar functionality it. see scrollbar handle? can drag somewhere else in document.

dropbox scrollbar @ top dropbox scrollbar @ bottom

this concept very similar how index bars work in uitableview (ie. contacts.app); index appears bar on right hand side of table (for example, "a" through "z"), , can touch particular label jump target section. in case, however, long page doesn't have sections, , should work general-purpose scrolling, not jumping sections.

so how can go implementing method of scrolling? i'm looking general ideas , specific implementation details. i'm interested if open-source implementation exists (this seems general-purpose problem/solution).

a general idea:

i grabbed dropbox app (it awesome) , played around bit. looks pdf viewing takes bit photo app in conditionally displays translucent navbar , toolbar on touches, in addition supporting scrollbar. i'm pretty sure what's going on have custom view controller intercepting touches , reacting accordingly.

on touch:

  1. if it's tap, show/hide navbar , toolbar.
  2. if it's on scrubber, begin tracking touch , scrolling scrollview/webview (whatever they're displaying with). i'm sure scrolling simple scrollview.contentoffset = cgpointmake(0, (scrubber.y / [uiscreen mainscreen].bounds.size.height) * scrollview.contentsize.height). 3)
  3. else, pass touch on enclosed view.

there may other hidden magic pdf displaying (i've never done in cocoa touch) tells me basic process.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -