4

I have an app with a few pictures. If the user clicks on one of them, I want him to be able to zoom, pan, scale and so on. I don't need something like Three20. First of all, I'm loading the images from file inside the app, second I don't need the "library" feature (that displays all the images in a grid > like the Photos.app). So I only need the part in the left picture...

enter image description here

How can I do that? Is there any "sample class" or tutorial?

Thanks a lot in advance!

Martin Herman
  • 888
  • 13
  • 34
  • I think you should make your own implementation for everything, if you want some help, try the WWDC 2010 video "Session 104 - Designing Apps with Scroll Views" and the example code for that session, they have good examples for the UIScrollView that can be useful. – Herz Rod Sep 13 '11 at 20:34

2 Answers2

6

The UIScrollView supports not only scrolling, but also zooming in and out, in fact, it's the super class of things like webViews and tableViews.

It's a matter of fitting an UIImageView inside an UIScrollView and make the contentSize match, and enable zooming (maximum/minimum zooming is 1.0 by default, setting it to something else allows zooming).

Can
  • 8,502
  • 48
  • 57
  • 2
    And: --- add support for UIScrollViewDelegate. Make the viewcontroller as delegate of the UIScrollView. --- Then add the implementation of "-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView" and return the imageView. – LolaRun Apr 12 '13 at 15:12
3

check out the Nibmus Project, they have a nice photos controller http://jverkoey.github.com/nimbus/group___nimbus_photos.html, which sounds to be exactly what you're looking for.

aporat
  • 5,922
  • 5
  • 32
  • 54