使用视口缩小网页

使用视口缩小网页

本文介绍了PhoneGap:使用视口缩小网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个我们将在工作中构建的应用程序的快速原型,以便我们可以对某些功能进行快速用户测试。



我的设计器我的图像以640px的宽度匹配iPhone 5的分辨率。所以为了使事情简单和快速我使用这个视口标签:

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

这在移动Safari中完美工作,但现在我已经将它包装在PhoneGap中,

>解决方案

我找到了。在项目的根目录中有一个'config.xml'。设置此行:

 < preference name =EnableViewportScalevalue =true/> 

像我在这里展示的代码片段一样,


I am creating a quick prototype of an App we are going to be building at work so we can do a quick user test on some functionality.

My designer created my images at a 640px width to match the resolution of the iPhone 5. So to make things simple and quick I used this viewport tag:

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

This work perfectly in mobile Safari but now that I have wrapped it in PhoneGap it is behaving like the scale is set to 1. Any thoughts on what I need to do to fix this?

Thank you.

解决方案

I found it. There is a 'config.xml' in the root of the project. Setting this line:

    <preference name="EnableViewportScale" value="true" />

To be 'true' like my snippet here shows, made the app scale correctly like it did online.

这篇关于PhoneGap:使用视口缩小网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 20:50