开发者

Why doesnt UIScrollView zoom when i click on it?

开发者 https://www.devze.com 2022-12-21 18:07 出处:网络
I subclassed UIScrollView Then created an object of it in the main class. Added an image to it. Set the zoomscalesas
  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开发者_StackOverflow社区 support pinch zoom?

Q. Shouldn't I do it programmatically?

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号