我似乎对下面的代码有一个特定于设备的问题,因为它只会在我测试时影响iPhone 3GS。
基本上,界面不会旋转。它适用于所有比3GS更新的iPad和iPhone。如果你能帮助我,我将不胜感激!
代码:
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { return YES; } else { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } }
在您的appDelegate didLaunch方法中,是否启用旋转:
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];