iPad/iOS 5 上的 PhoneGap 无法进行缩放

发布于 2024-12-29 13:53:18 字数 900 浏览 1 评论 0原文

我在 PhoneGap 应用程序中遇到缩放问题。我的问题与这个问题非常相似。我想允许用户在我的应用程序中缩放,因为它都是 UIWebView,所以它应该可以工作。我已将以下元视口标记放在本地 html 文件以及 PhoneGap 在身份验证后打开的远程站点上:

<meta name="viewport" content="width=device-width; user-scalable=yes; initial-scale=1; maximum-scale=5; minimum-scale=1" />

我还编辑了 PhoneGap.plist 并将 EnableViewportScale 设置为 YES。这些设置都没有任何区别。在 PhoneGap 中运行时我根本无法缩放页面。我们的用户期望应用程序能够扩展,因为他们已经习惯在浏览器中运行它。该应用程序显示图形文件、PDF 等,并且需要允许缩放。

我在本地登录页面上使用 jQuery-Mobile,但一旦定向到托管应用程序,就只有 jquery 和 varios

关于为什么 PhoneGap 不允许我的应用程序使用标准捏合和缩放手势进行缩放的任何想法?

编辑: 好的,奇怪的行为更新。现在缩放工作正常了,除了为应用程序的一部分添加 ChildBrowser 功能之外,我没有做任何更改。现在应用程序可以扩展。我怀疑 ChildBrowser 真的与它有任何关系,因为我可以在不使用 ChildBrowser 插件的情况下进行扩展。到底是怎么回事?我仍然想要答案,以便我知道它为什么有效,因为如果我不知道是什么让它开始工作,我很可能在未来的更新中再次失去缩放功能。

I have a scaling problem in a PhoneGap app. My issue is very similar to this question. I want to allow user scaling in my app and since it is all UIWebView it should work. I have put the following meta viewport tag on my local html files and on the remote site that PhoneGap opens after authentication:

<meta name="viewport" content="width=device-width; user-scalable=yes; initial-scale=1; maximum-scale=5; minimum-scale=1" />

I have also edited the PhoneGap.plist and set EnableViewportScale to YES. Neither of these settings makes any difference at all. I simply cannot scale the pages when running in PhoneGap. Our users expect scaling in the app because they are already used to running it in the browser. The app displays graphic files, PDFS, etc and needs to allow scaling.

I use jQuery-Mobile on the local login page, but once directed to the hosted app just has jquery and the varios

Any ideas as to why PhoneGap is not allowing my app to scale with the standard pinch and zoom gesture?

EDIT:
Ok, bizarre behavior update. Now scaling works and I didn't change anything except add ChildBrowser functionality for one part of the app. Now the app can scale. I doubt ChildBrowser really has anything to do with it because I can scale without ever using the ChildBrowser plugin. What is going on? I still want the answer so that I know why it works since I'm just as likely to lose scaling again in a future update if I don't know what made this start working.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

囍孤女 2025-01-05 13:53:18

当您测试扩展时,您是否在任何阶段使用 cmd+shift+k 清理项目?您会发现 Xcode 会大量缓存 index.html,因此每次部署到模拟器或设备时,您都应该清理项目以确保最新的 html 到达设备。我花了几个小时研究这样的莫名其妙的问题,结果才意识到这只是缓存起作用了。

这是可以通过再次进行更改进行测试的,删除缩放,不清理和部署。现在检查它是否仍然可以缩放。

When you were testing the scaling did you clean the project at any stage using cmd+shift+k? You'll find that index.html will be cached heavily by Xcode, so every time you deploy to simulator or device you should clean project to ensure the latest html gets to the device. I have spent hours on inexplicable problems like this only to realise that it's just caching taking effect.

This is testable by going through the changes again, remove the scaling, don't clean and deploy. Now check if it still scales.

メ斷腸人バ 2025-01-05 13:53:18

您可能需要在视图中添加对多点触控的支持。

theWebView 上的 multipleTouchEnabled 设置为 YES

You might need to add support for multi-touch in your view.

Set the multipleTouchEnabled to YES on theWebView.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文