Richard Sweeney
Richard Sweeney

Reputation: 782

JQuery mobile & phonegap = no landscape rotation?

I'm writing an iPhone app using jQuery mobile & phonegap. When I rotate my iPhone into landscape orientation, nothing happens. Clearly I'm missing something! Anyone more clever than I able to tell me what?!

Upvotes: 1

Views: 5319

Answers (3)

Magnus Smith
Magnus Smith

Reputation: 5963

For anyone using Phonegap Build and version 2.0.0, the solution may just be to change up to version 2.1.0 by amending your config.xml file.

Upvotes: 0

Rexb
Rexb

Reputation: 445

On iOS 6 you need to add the following in didFinishLaunchingWithOptions to respond to orientation changes:

 self.window.rootViewController = viewController;

Upvotes: 0

eddz
eddz

Reputation: 604

Have you set up landscape as a supported device orientation?

You can do this by showing the project navigator and clicking on your project, then selecting the relevant target. Under the "Summary" tab, look for "Supported Device Orientations" and make sure "Landscape Left" and "Landscape Right" have the pressed-in effect.

If they're both enabled, make sure this line is in your header:

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

Hope that helps!

Upvotes: 6

Related Questions