我不知道为什么,但是当我旋转 iPhone 时,我的 PhoneGap 应用程序没有旋转屏幕。发布代码是没有用的,因为它不适用于最简单的代码: <div>Hello World!</div

我也检查了方向设置:

这是一个例子(在实际设备上也会发生同样的情况):

最佳答案

对我来说同样的问题。我解决了它在我的代表上为 iOS6 添加以下行:

- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
{
    NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);

    return supportedInterfaceOrientations;
}

另外,在您的主 Controller 上,添加:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return true;
}

关于ios - Phonegap 不旋转方向?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12029323/

10-14 20:18
查看更多