2012-08-22 4 views
1

내 ipad 앱에 모달 뷰를 추가하려고합니다. 모든보기는 가로보기 모드로되어 있습니다. 스타일의 경우 양식 또는 페이지 시트를 선택했습니다.모달 뷰가있는 가로 모드

여기에 문제가 있습니다. 나는 다음과 같은 코드를 내보기로 모달 뷰를 추가 할 때 :

TempController *tmpViewController = [[TempController alloc] initWithNibName:@"TempView" bundle:nil]; 
tmpViewController.modalPresentationStyle = UIModalPresentationPageSheet; 
[self presentModalViewController:tmpViewController animated:YES]; 

내 모달 뷰는 가로 모드로 표시되어 있지만 아래의보기는 세로로 표시됩니다. 모달이 해제 된 후에도보기는 여전히 potrait입니다. 보기에 모달을 연결하지 않으면보기가 가로 모드로 잘 표시됩니다.

나는 statusBarOrientation 및 shouldAutootateToInterfaceOrientation으로 경기를했지만 여전히 운이 없다. 나는 산 사자

갱신에 엑스 코드 4.4.1을 실행하고이 내 shouldAutorotateToInterfaceOrientation입니다 :

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

답변

0

빠른 참고 : presentModalViewController:animated:를 사용되지 않습니다. Apple은 presentViewController:animated:completion:을 사용하도록 권장합니다.

모달 뷰 컨트롤러를 제공하는보기 컨트롤러가 가로 모드에서 올바르게 표시되지만 모달을 표시하자마자 모달보기 컨트롤러가 세로 모드로 변경되는 경우에도 가로로 올바르게 표시됩니까? iPhone/iPod touch 또는 iPad에서 이러한 현상이 발생합니까? shouldAutoRotateToInterfaceOrientation 메서드에 대한 코드 표시 형식은입니다.

+0

실제로 presentModal을 presentViewController로 변경했지만 여전히 동일한 문제가 발생합니다. – Irina

+0

님이 ToAutorotateToInterface 오리엔테이션을 원래 게시물에 추가했습니다. – Irina