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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With