Posts

Showing posts from June, 2012

The PhoneGap Viewport size is too small on Android?

Image
I spent quite some time today trying to figure out why, when I load an external HTML file into my PhoneGap (Apache Cordova) app, the viewport only filled part of the screen



Notice the big space at the bottom and the side border. I couldn't figure it out, so I started searching on Google:

Googled solution 1 - Set the viewport meta tag
Lots of the solutions I found involved setting the meta tag for the viewport, eg

<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0/>
However, this seemed to have absolutely no effect whatsoever.  I tried many variations of this

Googled solution 2 - Set the page to use all the space Other solutions involved setting CSS so that the page filled the screen, eg


html, body {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}
This also had absolutely no effect.  I was getting confused by now
Googled solution 3 - Set Android properties I found a couple of solutions that invo…