두 개의보기 제어기 A와 B가 있습니다. A는 대신 B가 가로를 지원할 수있을 때 세로만을 지원하기위한 것입니다. 봉쇄 API를 사용하여 B를 표시하고 있습니다.회전 및 격납 api
[self addChildViewController:child];
[self.view addSubview:child.view];
child.view.frame = self.view.bounds;
[child didMoveToParentViewController:self];
내가 구현 한
- (BOOL)shouldAutorotate
{
UIViewController *current = _presentingChild ? _child : self;
return [current shouldAutorotate];
}
- (NSUInteger)supportedInterfaceOrientations
{
UIViewController *current = _presentingChild ? _child : self;
return [current supportedInterfaceOrientations];
}
모든 매력처럼 작동합니다. 프리젠 테이션 중에 기기가 가로 방향이고 B가 나타나면 즉시 회전합니다.
B를 닫을 때 문제가 발생합니다. 가로가 A 인 경우 가로로 표시됩니다.
이 문제를 해결하는 방법에 대한 제안이 있으십니까? 저는 모달 컨트롤러를 사용할 수 있다는 것을 알고 있습니다. 그러면 문제가 해결 될 것입니다. 하지만이 특정 상황에 대해 모달 VC를 사용하고 싶지 않습니다.