views:

54

answers:

1
  1. I subclassed UIScrollView
  2. Then created an object of it in the main class.
  3. Added an image to it.
  4. Set the zoomscales as

    scrollview.minimumZoomScale = 0.25;
    scrollview.maximumZoomScale = 4.00;
    

After all this

Q. Is it supposed to zoom out when I double-tap on it and also support pinch zoom?

Q. Shouldn't I do it programmatically?

Q. Does UIImageView or someother class support this behavious by default?

+1  A: 

UIScrollView will not zoom unless you set the maximumZoomScale and/or minimumZoomScale.

And return the image in -viewForZoomingInScrollView: in your delegate. And implement -scrollViewDidEndZooming:withView:atScale:.

See http://discussions.apple.com/message.jspa?messageID=8453852#8453852 for detail.

KennyTM