Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scaling does not work with PhoneGap on iPad/iOS 5

I have a scaling problem in a PhoneGap app. My issue is very similar to this question. I want to allow user scaling in my app and since it is all UIWebView it should work. I have put the following meta viewport tag on my local html files and on the remote site that PhoneGap opens after authentication:

<meta name="viewport" content="width=device-width; user-scalable=yes; initial-scale=1; maximum-scale=5; minimum-scale=1" />

I have also edited the PhoneGap.plist and set EnableViewportScale to YES. Neither of these settings makes any difference at all. I simply cannot scale the pages when running in PhoneGap. Our users expect scaling in the app because they are already used to running it in the browser. The app displays graphic files, PDFS, etc and needs to allow scaling.

I use jQuery-Mobile on the local login page, but once directed to the hosted app just has jquery and the varios

Any ideas as to why PhoneGap is not allowing my app to scale with the standard pinch and zoom gesture?

EDIT: Ok, bizarre behavior update. Now scaling works and I didn't change anything except add ChildBrowser functionality for one part of the app. Now the app can scale. I doubt ChildBrowser really has anything to do with it because I can scale without ever using the ChildBrowser plugin. What is going on? I still want the answer so that I know why it works since I'm just as likely to lose scaling again in a future update if I don't know what made this start working.

like image 434
davidethell Avatar asked Nov 04 '22 06:11

davidethell


1 Answers

When you were testing the scaling did you clean the project at any stage using cmd+shift+k? You'll find that index.html will be cached heavily by Xcode, so every time you deploy to simulator or device you should clean project to ensure the latest html gets to the device. I have spent hours on inexplicable problems like this only to realise that it's just caching taking effect.

This is testable by going through the changes again, remove the scaling, don't clean and deploy. Now check if it still scales.

like image 84
sciritai Avatar answered Nov 09 '22 16:11

sciritai