Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Mobile Safari Meta Tags Not Working If Loaded Via LOCAL Webview

We have an app that uses a lot of webviews, and have managed to get the web content (images and text) looking correctly on iPHone4 high res and on older iPhones by making the page very large, and having the page scale automatically using this meta tag in the html of the page:

<meta name="viewport" content="width=device-width; 
initial-scale=0.5; maximum-scale=0.5; user-scalable=0;" />

It's working perfectly on remotely loaded urls, but I need to add some event calls to the remote HTML, and from what I've read here, I can only trigger those events if the html loaded in a web view is loaded locally. So, I cam grabbing the remote HTML, saving it locally, then opening it as I did before. The issue is that if the page is loaded locally, the meta tag above is ignored…

So, I have 2 questions.

1) Is there ANY way to allow remote html to fire Titanium events, or is that really only possible from locally loaded html?

2) Is there any way to apply the meta tag:

<meta name="viewport" content="width=device-width; 
initial-scale=0.5; maximum-scale=0.5; user-scalable=0;" />

to locally loaded html?

Thanks,

Peter Janett

— asked August 17th 2010 by Peter janett
  • device-width
  • initial-scale
  • iphone4
  • javascript
  • meta
  • remote
  • tag
  • viewport
  • webview
3 Comments
  • Did you find the solution?

    — commented August 2nd 2012 by Adnan Ahmad
  • Modify the following example that sets viewport properties dynamically:

    https://gist.github.com/933459

    — commented September 12th 2012 by Dejay Clayton
  • @Dejay Clayton, Thank you for that github link, it worked perfect for me.

    — commented March 22nd 2013 by Oguz Furkan Kaytancı

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.