0

다른 방향 문제가 있습니다. 그러나 이것은 매우 까다 롭습니다. 내 RootViewController는 일반적인 NavigationController입니다.방향 풍경 -> 세로가 작동하지 않습니다.

self.window.rootViewController = _naviController; 

내부에 다른 ViewController가있는 경우 VC1을 호출 할 수 있습니다. VC1에는 일부 단추와 레이블이 있습니다. 그 폴더와 같은 개요.

내가 (내부 사진/썸네일을보고 폴더 안에 같은) 내가 3의 ViewController (페이지)와 다음의 ViewController에 와서 버튼과 버튼의 또 다른 무리를 누르면 :에는 loadView에

Archiv *archiv = [[Archiv alloc] init]; 
[self.navigationController pushViewController:archiv animated:YES]; 
[archiv release]; 

: 나는 지금 세 번째의 ViewController를 밀어 버튼을 다시 활성 페이지를 클릭하면

firstPage = [[Page alloc] initViewWithFrame:CGRectMake(0, 0, 768, 960)]; 
[firstPage setRootViewController:self]; 
secondPage = [[Page alloc] initViewWithFrame:CGRectMake(0, -960, 768, 960)]; 
[secondPage setRootViewController:self]; 
thirdPage = [[Page alloc] initViewWithFrame:CGRectMake(0, 960, 768, 960)]; 
[thirdPage setRootViewController:self]; 

(드래그, 크기 조정으로 이미지를 ...) :

Picture *pic = [[Picture alloc] initWithPicURLString:urlString]; 
[rootViewController.navigationController pushViewController:pic animated:YES]; 
[pic release]; 

NavigationController의 BackButton을 사용하면 항상 이전 뷰로 돌아갈 수 있습니다.

좀 더 정보 :

  • 마다의 ViewController는
  • 모든 ViewControler가 이미 Apple's Q&A: Why won't my UIViewController rotate with the device
  • 을 읽을
  • 자신의 초기화 - 메도의 [super init]를 호출 return YES;
  • 마다의 ViewController가 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 구현 모든 방향을 지원합니다

이제 까다로운 문제는 : 나는 3 VC에 2 VC에서 전환하는 경우

, 풍경에 세로부터이 방향을 변경하고 변경의 BACK 버튼의 모든 (shouldAutorotateToInterfaceOrientation 호출하는 노력 프레임 크기와 기원을 누르십시오 ...). 나는이 다른 방식으로 할 경우 하지만, 나는 풍경 모드, 3 VC에 2 VC에서 스위치에서 오전 세로를 회전에있다 BACK 버튼의 상태 -와 controllerBar와 2 VC로 돌아와 정상이지만 shouldAutorotateToInterfaceOrientation이라고하지 않았습니다.

도와주세요. $ h @ rky

답변

1

은 나를 위해 작동이 시도 라는 ListViewController 기능에

ListCurrentViewController *list = [self.storyboard 
    instantiateViewControllerWithIdentifier:@"ListCurrentViewController"]; 
       [self.navigationController presentViewController:list animated:NO completion:Nil]; 
       [list dismissViewControllerAnimated:NO completion:Nil]; 
       [self.navigationController pushViewController:list animated:YES]; 

:

,536는 세로 presentViewController 예에 풍경에서 컨트롤러를 볼 누르면 당신이 코드를 해킹해야, 그것은 평균의
(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation // iOS 6 autorotation fix { return UIInterfaceOrientationPortrait; } 

는 당신은 UINavigationController가

나는이 당신을 도울 것입니다 해결 희망
(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { 
    return [self.visibleViewController preferredInterfaceOrientationForPresentation]; 
} 

에 대한 범주를 만들어야합니다.

+0

그래,이 작품도,하지만이 질문에 대답하지 않는 이유는 내가 다시 세로 방향으로 돌아올 때 전화를하지 않습니다. nodoby가 다음 주에 왜 이런 일이 일어나는 지 알려주면 어쨌든 대답을 받아 들일 것입니다. – Sharky

+0

나는 해상도와 업보트가 내 방식 xD보다 더 똑똑하기 때문에 나는 약속과 upvote를 약속했다. $ h @ rky – Sharky

0

오늘 나는 그 원인을 모른 채 문제를 해결 한 아이디어를 얻었다. 제 3의 VC에서 나는 방금 두 번째보기에 대한 포인터를 만들고 shouldAutorotateToInterfaceOrientation라고했습니다.

그러나 요점은 여전히 ​​동일합니다. 설명 된 상황에서 shouldAutorotateToInterfaceOrientation이 호출하지 않는 이유는 무엇입니까?

친절하게 제공합니다.다음, 여전히 풍경 컨트롤러를 볼

사용자가 회전 할 경우에만 호출
-(void)viewWillAppear:(BOOL)animated 
{ 
    [super viewWillAppear:animated]; 
    [self shouldAutorotateToInterfaceOrientation:[[UIApplication sharedApplication] statusBarOrientation] ]; 
} 
0

shouldAutorotateToInterfaceOrientation, 그렇게 할 때 가로에서 세로로 또는 다른, 그래서이 문제를 해결한다 : $ H @의 rky