-1

我似乎在下面的代码中遇到了特定于设备的问题,因为它仅在我测试时影响 iPhone 3GS。

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

代码:

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        return YES;

    } else {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    }
}
4

1 回答 1

0

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

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
于 2012-07-18T17:57:37.370 回答