Phonegap iFrame /页面缩放 [英] Phonegap iFrame/page scaling

查看:243
本文介绍了Phonegap iFrame /页面缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在处理移动设备时使用以下代码的页面

I have a page that uses the following code when dealing with mobile devices

<meta name="viewport" content="width=device-width, initial-scale=.7, maximum-scale=2, user-scalable=1">

在移动设备上的网络浏览器中查看此代码非常有用。现在我试图在应用程序的iframe中创建一个 Phonegap 应用程序。但是,缩放/视口根本不工作。无论我为缩放放置的数字,比例仍然是相同的。它不会改变。

This code works great when viewed in a web browser on a mobile device. Now I am trying to create a Phonegap application with this very same page in an iframe in the application. However, the scaling/viewport is not working at all. Regardless of the numbers I put in for the scaling, the scale is still the same. It will not change.

我试图这样做的原因是我的 Phonegap 应用程序绑在一起两通过两个iframe在相同的 Phonegap 页面上的外部页面,我需要两个页面,以便能够一次查看,而不会在屏幕外面。

The reason I am trying to do this is that my Phonegap application is tying together two external pages on the same Phonegap page via two iframes and I need both pages to be able to be viewed at one time without running out side the screen.

任何人都有任何想法,如何在 Phonegap 中使用/启用缩放iframes?谢谢。

Anyone have any ideas as to how I can use/enable scaling using iframes in Phonegap? Thanks.

推荐答案

最后找到答案。有人将其发布在 Phonegap Google 组。以下是他们的回应:

Finally found the answer. Someone posted it on the Phonegap Google group. Here's their response:


尝试将EnableViewPortScale设置设置为true: http://docs.phonegap.com/en/2.4.0/guide_project-settings_ios_index.md .html#Project%20Settings%20for%20iOS

所以我添加了以下到我的config.xml文件,现在缩放像我想要的。只需要注意,您必须在视口上使用 Phonegap 降低正常值才能达到同样的效果。

So I added the following to my config.xml file and it's now scaling like I want it to. Only caveat is that you have to go lower than normal on the viewport with Phonegap to achieve the same effect.

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

这篇关于Phonegap iFrame /页面缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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