iphone - How do I programmatically zoom a UIScrollView? -


i'd zoom , unzoom in ways base class doesn't support.

for instance, upon receiving double tap.

i'm answering own question, after playing things , getting working.

apple has very-simple example of in documentation on how handle double taps.

the basic approach doing programmatic zooms yourself, , tell uiscrollview did it.

  • adjust internal view's frame , bounds.
  • mark internal view needing display.
  • tell uiscrollview new content size.
  • calculate portion of internal view should displayed after zoom, , have uiscrollview pan location.

also key: once tell uiscrollview new contents size seems reset concept of current zoom level. @ new 1.0 zoom factor. you'll want reset minimum , maximum zoom factors.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -