2013-02-08 5 views
0

내 응용 프로그램은 항상 홈 모드 왼쪽에 가로 모드로 실행됩니다. 오른쪽 홈 버튼이 회전하면. 어떻게 반대로 만들 수 있습니까? 나는 initial interface orientation 키에 대한 info.plist 파일에 다른 값을 설정하려했지만 작동하지 않았다. 나는이 방법에서 값의 순서를 바꾸려고 시도했다.초기 인터페이스 방향을 설정하는 방법은 무엇입니까?

그러나 작동하지 않았다. 어떻게해야합니까? IOS 5 5.1

+0

시뮬레이터가 뒤집 혔음을 의미합니까? Command + Arrow Keys를 사용해보십시오 – Luke

+0

무엇을 원하십니까? 모의 실험 장치? 방향, 장치가 아니라 시뮬레이터 –

+0

보기 컨트롤러에서 방향을 올바르게 설정 했습니까? iPad의 방향이 잠겨 있습니까 (오른쪽의 주황색 스위치)? – Luke

답변

4

:

시도가 설정 (BOOL)shouldAutorotateToInterfaceOrientation 뷰 컨트롤러에, 그것은 나를 위해 작동합니다.

enter image description here

enter image description here

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    return toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight; 
} 

당신은 또한 가로 모드로 초기 및 기타 viewcontrolers 설정할 수 있습니다 당신은 스토리 보드를 사용하는 경우 : IOS 6

enter image description here

:

귀하의 (NSInteger)supportedInterfaceOrientations(NSUInteger)이어야합니다. 사용하지는 않지만 확실하지 않습니다.

// Only used by iOS 6 and newer. 
- (BOOL)shouldAutorotate 
{ 
    //returns true if want to allow orientation change 
    return TRUE; 

} 
- (NSUInteger)supportedInterfaceOrientations 
{ 
    //decide number of origination to supported by Viewcontroller. 
    return return UIInterfaceOrientationMaskLandscape; 


} 
+0

shouldAutorotateToInterfaceOrientation은 결코 호출되지 않습니다. 그리고 지원되는 인터페이스 방향에서 LandscapeLeft를 제거하면 내 앱이 회전하는 대신 회전하지 않습니다. –

+0

우물은 당신이 IOS 6을 위해 개발하고 있다는 것을 의미합니다.'(BOOL) shouldAutorotateToInterfaceOrientation'은 이전 버전을위한 것입니다. –

+0

@ AndreyChernukha 어떻게 rootviewcontroller를 설정합니까? –

관련 문제