Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Photo viewer (with zoom, pan, scale etc)? Alternative to Three20

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!

like image 728
Martin Herman Avatar asked Jan 19 '23 18:01

Martin Herman


2 Answers

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).

like image 137
Can Avatar answered Jan 21 '23 07:01

Can


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.

like image 34
aporat Avatar answered Jan 21 '23 07:01

aporat