PhoneGap and Retina display

情到浓时终转凉″ 提交于 2019-12-03 05:11:25

问题


I'm creating an app for iPhone using phoneGap, but I'm sure it is not working using retina display, instead of that, it is using the old iPhone3 resolution.

Is there any way to have 2 versions for iPhone when developing using phoneGap? this is, one version using retina and another version with worst resolution for the older devices.

Thanks


回答1:


Yes, but you'll need to use either CSS media queries or JavaScript.

http://troymcilvena.com/post/998277515/jquery-retina is a jQuery plugin that'll automatically handle @2x images.

In CSS, you'd need to use a media query targeting -webkit-min-device-pixel-ratio: 2 that replaces background images with their higher-resolution versions (and sets background-size).




回答2:


Retina.js with less CSS it will solve your problem.

On the other hand, for problems with Phonegap (e.g.: you don’t see the page like it should, instead you see everything zoomed in) after using the following code in your app:

<meta name="viewport" content="width=device-width, user-scalable=no, initial-
scale=0.5, maximum-scale=0.5" />

Add this into your Cordova.plist:

EnableViewportScale : YES


来源:https://stackoverflow.com/questions/7612330/phonegap-and-retina-display

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!