Phonegap doens't在视网膜显示器上工作良好 [英] Phonegap doens't work well on retina display

查看:111
本文介绍了Phonegap doens't在视网膜显示器上工作良好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个iPhone html5应用程序,而没有实际编译它。我测试作为一个网络应用程序(在主屏幕上的书签和儿子)。



我使用这个片段让它在iphone上看起来不错:



meta name =viewportcontent =width = device-width,user-scalable = no,initial-scale = 0.5,maximum-scale = 0.5/>



一切都是peachy,但当我完成所有的东西,并试图编译为一个真正的应用程序(使用phonegap作为包装)我发现上述代码片段完全被忽略,应用程序看起来放大。



我在 github 修复是:


我通过将它添加到第180行的PhoneGapDelegate.m来修复它:



webView.scalesPageToFit = YES;


两个问题:




  • 网页不再可用(我猜他们搬走了或什么)

  • 我在我的项目中没有任何惊人的 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:

I fixed it by adding this to the PhoneGapDelegate.m on line 180:

webView.scalesPageToFit = YES;

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 is AppDelegate.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在视网膜显示器上工作良好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆