我似乎在下面的代码中遇到了特定于设备的问题,因为它仅在我测试时影响 iPhone 3GS。
基本上,界面不会旋转。它适用于所有比 3GS 更新的 iPad 和 iPhone。如果您能帮助我,我将不胜感激!
代码:
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
} else {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
}