代码之家  ›  专栏  ›  技术社区  ›  klcjr89

轮换问题仅适用于iPhone 3GS

  •  -1
  • klcjr89  · 技术社区  · 12 年前

    我似乎对下面的代码有一个特定于设备的问题,因为它只会在我测试时影响iPhone 3GS。

    基本上,界面不会旋转。它适用于所有比3GS更新的iPad和iPhone。如果你能帮助我,我将不胜感激!

    代码:

    - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
            return YES;
    
        } else {
            return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
        }
    }
    
    1 回复  |  直到 12 年前
        1
  •  0
  •   David Hoerl    12 年前

    在您的appDelegate didLaunch方法中,是否启用旋转:

    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];