2

App Store にピアノ アプリがあります。ランドスケープモードで動作します。

ここに画像の説明を入力

iOS 7 が IB のランドスケープ設定を無視しているように見える

ここに画像の説明を入力

アプリは、iOS 6 以下の横向きで期待どおりに動作します。iOS 7 では縦向きで表示されます。設定と関連コードは次のとおりです。

ここに画像の説明を入力 ここに画像の説明を入力

//iOS 6+
- (BOOL)shouldAutorotate
{
    return YES;
}

//iOS 6+
- (NSUInteger)supportedInterfaceOrientations
{
    return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight);
}
//iOS 5.1.1-
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
4

1 に答える 1