나는 그 작업입니다 응용 프로그램에 문제가 이렇게 가고 있습니다아이 패드 모달 뷰 컨트롤러는 해고에 대한 인터페이스를 회전
응용의 창 UIViewController
의 사용자 정의 클래스 (MenuViewController
)로 설정되어 rootViewController
있습니다. 이 뷰 컨트롤러에는 자신의 속성 인 rootViewController
이 있습니다. 이 rootViewController의의
- (void)setRootViewController:(UIViewControlelr *)rootViewController
{
...
_rootViewController = rootViewController;
if (self.rootViewController) {
[self addChildViewController:rootViewController];
[self.view addSubview:rootViewController.view];
}
...
}
지금이 MenuViewController
가 상단에 모달 뷰 컨트롤러를 표시 할 수 있습니다 : 설정할 때마다이 (코드의 정말 짧은 버전) 발생합니다.
나는 이런 식으로 그렇게 :
[self.rootViewController presentModalViewController:viewController animated:YES completition:nil];
모든 것이 여기까지 확인을 것으로 보인다. 이제 iPad에서 내 모달보기 컨트롤러에서 [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]
을 호출 할 때마다보기 컨트롤러가 표시 될 때 초기 방향이 무엇인지에 관계없이 그 아래의 인터페이스가 동일한 방향 (즉, UIInterfaceOrientationLandscapeLeft
)으로 회전합니다.
Window
|
- Menu View Controller
|
- Root View Controller
|
- Modal view controller
사람이 내가이 문제를 해결할 수있는 방법을 알고 있나요
:그래서 내보기의 계층이있다, 결론? 그것은 아이폰에서 발생하지 않습니다.
나는 실제로'preferredInterfaceOrientationForPresentation'을 구현하고'self.interfaceOrientation'을 반환함으로써 그것을 고쳤습니다. 당신이 나에게 묻는다면 이상하지만 그 일을 했어! :) –