问题描述
我开发了一个iPhone html5应用程序,而没有实际编译它。我测试作为一个网络应用程序(在主屏幕上的书签和儿子)。
我使用这个片段让它在iphone上看起来不错:
meta name =viewportcontent =width = device-width,user-scalable = no,initial-scale = 0.5,maximum-scale = 0.5/>
一切都是peachy,但当我完成所有的东西,并试图编译为一个真正的应用程序(使用phonegap作为包装)我发现上述代码片段完全被忽略,应用程序看起来放大。
我在修复是:
两个问题:
- 网页不再可用(我猜他们搬走了或什么)
- 我在我的项目中没有任何惊人的
PhoneGapDelegate.m
唯一不知何故的相关文件是AppDelegate.m
或smth,这根本不起作用。
我发现的另一个修复是,它不工作。我在此行上遇到错误:
webView.frame = webViewFrame; //`webView` undeclared(在此函数中第一次使用)
编辑
我终于找到了
懒惰的答案将它添加到您的 PhoneGap.plist
:
EnableViewportScale:YES
I developed an iPhone html5 app without actually compiling it. I tested as a web app (with a bookmark on home screen and son on).
I used this snippet to make it look nice on iphone:
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=0.5, maximum-scale=0.5" />
Everything was peachy but when i finished everything and tried to compile as a real app (using phonegap as a wrapper) i discovered that the above snippet is totally ignored and the app looks zoomed in.
I found a similar issue on github and the fix is:
But there are two issues:
- the web page is not available anymore (i guess they moved out or something)
- i don't have any freaking
PhoneGapDelegate.m
in my project! The only somehow related file isAppDelegate.m
or smth which doesn't help at all.
Another fix that i found is this which... it doesn't work. I get an error on this line:
webView.frame = webViewFrame; // `webView` undeclared (first use in this function)
So... Any idea on how to make this to work?
Thanks!
EDIT
I finally found the answer
The Answer for the lazy add this into your PhoneGap.plist
:
EnableViewportScale : YES
这篇关于Phonegap doens't在视网膜显示器上工作良好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!