この質問が重複している場合は申し訳ありませんが、同じ解決策が見つかりません。iOS6 では、1 つの UIViewController のデフォルトの向きを設定する場合は、次を使用します。
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscapeLeft;
}
しかし、iOS5 で同じことを行うには、両方をテストします。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft);//not default
}
and
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return (toInterfaceOrientation == UIInterfaceOrientationMaskLandscapeLeft);// = return NO;
}
しかし、デフォルトの向きは常に Portrait.Any 提案?