2013-02-03 3 views
0

내 응용 프로그램에 7 개의보기 컨트롤러가 모두 세로보기 모드입니다. 이제 방향을 모두 지원하는 또 다른보기 (8 번째보기)를 표시해야합니다. 이 세 가지 방법을 구현했지만 화면이 가로 모드로 회전하지 않습니다. 제발 제안 해주세요.단일보기의 방향 문제 iOS 6

- (BOOL)shouldAutorotate{ 
    return YES; 
} 

- (NSUInteger)supportedInterfaceOrientations{ 
    return UIInterfaceOrientationMaskAllButUpsideDown; 
} 

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{ 
    return UIInterfaceOrientationMaskAllButUpsideDown; 
} 
+0

iOS6의 내비게이션 컨트롤러 –

+0

내부에있는 뷰 컨트롤러를 사용하여 지원되는 방향을 'Info.plist' 파일에 넣거나 애플리케이션 위임 클래스에'-application : supportedInterfaceOrientationsForWindow :'메소드를 구현하면 모든 것이 잘 작동합니다. – holex

답변

0

당신은하여 AppDelegate에에 다음을 구현해야한다 :

- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {  

return self.rotateToLandScape ? 
    UIInterfaceOrientationMaskAllButUpsideDown : 
    UIInterfaceOrientationMaskPortrait; 

}

은 다음 8 화면에서 true로 self.rotateToLandScape을 설정해야합니다.

+0

지금 작동합니까? –

+0

예. 지금은 잘 작동합니다. 고마워 .. – Earth

+0

내 대답이 도움이된다면 다른 사람들을 위해 해결 된 것으로 표시해주세요. –