views:

1675

answers:

3

How do you force an iPhone web app (not a native app) into landscape mode?

+1  A: 

I do not think it is possible to force the device into landscape mode. It is possible to detect when the device is in landscape mode. See here for example javascript: http://www.engageinteractive.co.uk/blog/2008/06/19/tutorial-building-a-website-for-the-iphone/

davidfg4
A: 

Either:

application.statusBarOrientation = UIInterfaceOrientationLandscapeRight;

Or in the Plist:

<key>UIStatusBarOrientation</key>
<string>UIInterfaceOrientationLandscapeRight</string>
Kriem
I think that’s for a native app, not a web app.
Paul D. Waite
A: 

I don't know how to force it on startup, but I found a neat way to make your content scale correctly when changing from Portrait to Landscape, especially if you're using canvas.

<head>
  <meta name="viewport" content="initial-scale=1.6; maximum-scale=1.0; width=device-width; "/>
  ...
</head>

So, as soon as your user flips the phone to landscape mode, your page will appear in the correct scale.

Luke Venediger