Phonegap page has wrong rotation, shows as portrait in landscape mode

你。 提交于 2019-12-05 12:10:16
Tom

You can check the root Controller - shouldAutorotateToInterfaceOrientation, allow rotation for certain orientation. Hope it helps.

For example return true in Classes/MainViewController.m:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    //return (interfaceOrientation == UIInterfaceOrientationPortrait);
    return true;
}
Jay

Following Tom's reply to the question, I thought I'd share a solution for those rebuilding an app with an older version of XCode and iOS. I don't recall the older versions I had, but I am now on XCode 4.6.1 using a Base SDK of iOS 6.1. I'm sure I was using a Base SDK of iOS 5.x previously.

I have replaced it with the following line:

[self.window addSubview:self.viewController.view];

...with the line below, and the orientation is corrected:

self.window.rootViewController = self.viewController;
JDev

Try to use meta tag

<meta name="viewport" content="width=720,maximum-scale=1.0" />

and for more read this page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!