2012-05-07 13 views
0

私はUIViewController次のようにロードしていますでは開きません。UINavigationコントローラは、ランドスケープモード

-(void)logIn 
{ 
    NewSignInView *viewController = [[[NewSignInView alloc] init] autorelease]; 

    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController]; 
    [self presentModalViewController:navController animated:YES]; 
    [navController release]; 

    [UIView animateWithDuration:0.3 
          delay:0 
         options:UIViewAnimationCurveEaseOut 
        animations:^{ self.view.alpha = 0; } 
        completion:^(BOOL finished){ }]; 
} 

NewSignViewユーザからの入力を取得するためにUITableViewを作成UIViewControllerです。 UINavigationControllerを使用して読み込むと、横向きモードで開くことを拒否します。しかし、もし私が直接CCDirectorにそれをロードすると、次のようにして、それはランドスケープで適切に開きます。

[[[CCDirector sharedDirector] openGLView] addSubview:viewController.view]; 

私はNewSignInView内で次のようにします。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 

だから、何かがランドスケープモードで開くからUINavigationControllerを妨げています。何が原因で問題が発生しているのか理解しようとすると、どなたでも助けてくれますか?あなたのshouldAutorotateToInterfaceOrientationで次

おかげ

答えて

1

てみてください。方法:

return UIInterfaceOrientationIsLandscape(interfaceOrientation); 

だからあなたのコントローラは、LandscapeRightだけでなく、両方の回転をサポートしています。 shouldAutorotateToInterfaceOrientationにlogIn-Methodを指定したViewControllerがYESを返すようにしてください。

これが役に立ちます。 さらに、私は1つの提案をします。混乱を避けるために、ViewController NewSignInViewにControllerを指定しないでください。もしそれがほんの素早く素敵な例だったら - 気にしないでください。

greets

関連する問題