pinch zooming for a UIWebView for ios 3.0 and newer

风格不统一 提交于 2019-12-11 05:08:07

问题


I've been reading about how to support the zooming for a webview, and i've found a lot of resources. And now i'm really lost.

What i've read:

  • all you need is to enable the 'scales page to fit'
  • add the uiwebview inside a uiscrollview (while setting the
    minimum/maximum zoom scale and
    implementing - (UIView
    *)viewForZoomingInScrollView:(UIScrollView *)scrollView)
  • then you might need to handle the touchdown events... manually then you might have to
    recognize them... manually... or
    using a gesture recognizer.

And apple documentation doesn't really help, and i can't really tell which ios are they talking about? I'm really lost now.

So if some veteran in coco-touch (which is very rare to find) can guide us.

  • Do i need a uiscrollview?
  • What do i really need to implement?
  • When would i need to capture touches events, recognize the gestures, and the zooming work.

And which is required in approximately which ios. Maybe this topic will help me and other people like me.

Thanks a lot in advance


回答1:


Just enabling scalesPageToFit should do it; however, it's only possible to zoom to 100%, which also means that you can't zoom a page which is less than or equal to the screen size to begin with.



来源:https://stackoverflow.com/questions/4646365/pinch-zooming-for-a-uiwebview-for-ios-3-0-and-newer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!