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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -