내 응용 프로그램에 문제가 있습니다. 특정보기에서 잠금 회전을 원합니다. 이를 위해 두 개의 사용자 정의 viewController가 포함 된 rootviewcontroller를 사용합니다. 두 뷰 컨트롤러에서 shouldAutorotateToInterfaceOrientation 메서드를 재정의하려고 시도했지만 내 rootViewController에서 모든 회전을 허용하면 내 모든 viewcontroller가 내 rootviewcontroller처럼 회전 할 수 있으며 이유를 이해할 수 없습니다. RootviewController 및 viewControllers 순환
RootviewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
//By default, i allow all rotation
return YES
}
FirstCustomviewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
//On my first viewController, I allow only orientation in portrait
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
그러나 모든 경우에
, 그것은 왜 나는이 방법을 재정의 할 수 없습니다 (나는 그것이 rootviewcontroller에서 오는 생각) 모든 회전 수 : 사실 나는이 구성을 사용할 수 있습니까? 어떻게해야합니까?감사
이렇게하는 것은 좋지 않습니다. :(사용자의 응용 프로그램에 넣는 모든 개별 UIViewController에 대한 사용 가능한 방향을 지원해야합니다. :) – holex