1

iOS7 にアップデートした後、アプリで自動回転が表示されます。横向き専用のアプリにしたいので、次のようにすべてを設定しました。iOS6では問題ありませんでした。

ここに画像の説明を入力

.plist ファイル内:

ここに画像の説明を入力

私のMainWindowコントローラーで

-(BOOL)shouldAutorotate
{
    return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

次のAppDelegate.mように呼び出します。

 MainViewController* mainViewController = [[MainViewController alloc] init];
    // Create the navigation controller
    UINavigationController *navController = [[UINavigationController alloc]
                                             initWithRootViewController:mainViewController];


    [navController setNavigationBarHidden:NO];
    [[self window] setRootViewController:navController];

しかし、デバイスを回転させると、アプリは縦向きモードで自動回転します。iOS 6 では、そのような動作はありませんでした。

4

1 に答える 1

3

このようにしてみて、

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationLandscapeLeft;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return (UIInterfaceOrientationMaskLandscape);
}
于 2013-11-05T09:19:38.687 に答える