开发者

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?!


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!


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

 self.window.rootViewController = viewController;


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜