次のコードを使用して、iPadアプリをランドスケープモードに設定しました。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
return NO;
}
return YES;
}
}
シミュレーターを手動で回転させると、横向きになり、縦向きモードにはなりません。
起動中、アプリはポートレートモードになります。
ランドスケープモードのみを検出するにはどうすればよいですか、またはランドスケープモードのみに設定するにはどうすればよいですか?
BuildSettingsからも試しましたが、問題を解決できませんでした...