Phonegap iFrame/page scaling

565 views
Skip to first unread message

The Duke Of Marshall

unread,
Feb 13, 2013, 4:01:54 PM2/13/13
to phon...@googlegroups.com

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">

This code works great when viewed in a web browser on a mobile device. Now I am trying to create aPhonegap 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.

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.

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

Shazron

unread,
Feb 13, 2013, 4:42:01 PM2/13/13
to phonegap


--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

The Duke Of Marshall

unread,
Feb 13, 2013, 10:16:44 PM2/13/13
to phon...@googlegroups.com
Outstanding! That seems to have done it. Thanks for pointing that out. Call me crazy, but it also seems to have sped up my app as well. Don't know how, but I'll take it. Seems logical to have that scaling/viewport turned on by default. Just my humble opinion.

I know the link/page that you posted was for iOS, but seeing as how it's part of the config.xml file I would assume it would also carry over to Android as well? Not sure if it's supposed to or not, but I just did a build and tested on my ICS phone and JellyBean tablet and it worked on both. I don't own any crapple products, but the app is being developed for iOS as well. So I can test on an iPad when I get to work tommorrow.

The Duke Of Marshall

unread,
Feb 14, 2013, 11:09:02 AM2/14/13
to phon...@googlegroups.com
So I got to work this morning and tried the build on the iPad here at the office and it's not working. Doesn't seem like the iPad recognizes viewport at all.

I have the viewport option enabled in the config.xml now and within each frame I'm using the following

<meta name="viewport" content="width=device-width, initial-scale=.7, maximum-scale=2, user-scalable=1">
Still can't figure out what's going on here or how to get the pages to scale within the frames.

The Duke Of Marshall

unread,
Feb 14, 2013, 11:37:51 AM2/14/13
to phon...@googlegroups.com
Here's the two views I'm getting with the same Phonegap app. The first is from my Android tablet and the second is from the apple ipad.


The Duke Of Marshall

unread,
Feb 14, 2013, 12:30:15 PM2/14/13
to phon...@googlegroups.com
Ok, finally found a way around it that works for both the Android devices and the crapple devices. It's a simple css zoom setting:

html, body {
    zoom: 0.8;
Reply all
Reply to author
Forward
0 new messages