iPad Simulator WebView/Google Maps API Issue

2019-07-13 07:57发布

I've only recently updated XCode to 3.2.2 and started to play with the iPad simulator.

I am having an issue with a WebView. I am using it to load a url with a Google Maps API implementation. The map loads and displays properly but when I try and click and drag on it to pan the map around instead of the map being panned the whole webview is scrolled vertically, revealing the dark grey background. When I release it it bounces back into place.

Also when I hold the option key down to pinch the map it does not respond. If I load the map.google.com page the map pans just fine and is responsive, but not my one. No special code here, just the usual NSUrlRequest. It works fine in the iPhone simulator, but not the iPad simulator. User Interaction Enabled is also checked.

Any thoughts on why this is happening?

3条回答
Deceive 欺骗
2楼-- · 2019-07-13 08:16

This looks like a glitch in the simulator.

I'd suggest to:

  • try an older or newer version of the ipad simualtor
  • try the iphone simulator to see if the problem persists
  • try on a device

you might eventually share with us the URL and the other code so we might check if there are obvious troubles.

查看更多
We Are One
3楼-- · 2019-07-13 08:17

This issue appears to have been fixed in Xcode 3.2.3 but anyone using 3.2.2 who experiences this issue may also be able to solve it by adding this HTML5 meta tag:

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

to the head section of their HTML.

查看更多
\"骚年 ilove
4楼-- · 2019-07-13 08:32

It seems that the webView is not passing events to the page content.
Since it works ok in iPhone simulator, I would check if somewhat changed in UIKit from OS 3.1.3 to OS 3.2
What's new in iPhone OS 3.2 should be a good starting point, and also the API differences list should be useful.
I saw, for instance that UIWebView is implementing a new protocol in OS 3.2:

 UIScrollViewDelegate
that was not present in OS 3.1.3. That could be some It's not much of a solution, I know, but it's in this direction that I would investigate.

查看更多
登录 后发表回答