简体   繁体   中英

UIWebView Zoom Issue

How can we identify that a user has zoomed the webView so as to resize the other components present. My webView starts from the middle of the screen and when a user zooms the webView it starts to scroll horizontally and vertically but it happens within the webView.The scrolling happens internally. I want to lock the webView from scrolling internally so that when a user scrolls vertically, the labels,textfields etc. on top of the webView also scroll up and not the webView alone. What I want to achieve is pretty similar to iPhone Native Email Client. For accomplishing this, I would like to put this webView on top of a scrollView and when a user zooms it, I would like to reset the content size of my scrollView so that whatever is added to the scrollView like labels and textfields above the webView also scroll when I scroll the webView.

Any ideas?

You could do:

  • Disallow user to pinch zoom the webview
  • Detect double tap on your scrollview and toggle webview's scalesPageToFit property AND set userInteractionDisabled on webview

Now you can scroll only scrollview which has all the controls..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM