Large page in UIWebview not always scrolling diago

2019-08-04 17:45发布

问题:

I have a page in a UIWebview whose main element is taller and wider than the webview itself. I'd like to be able to "pan" around the page smoothly in any way the user chooses: horizontally, vertically, diagonally or swiping in a circular motion.

Usually it works, however around once in every three gestures, the UIWebView scrolls on only one axis (sometimes x, sometimes y), despite gesturing on both simultaneously.

The problem tends to happen most often just after the webview has loaded. After a successful two-dimensional scroll it tends not to happen so often again.

Has anybody else seen this problem or any idea what to do about it?

回答1:

Found out what it was. I had a UIScrollViewDelegate listening to the UIWebView's UIScrollView for doing all sorts of other stuff I probably shouldn't. And the symptoms in the question are why!



标签: ios uiwebview