가능한 중복 :
ViewController not responding to didRotateFromInterfaceOrientation회전했을 때 RotateFromInterfaceOrientation이 실행되지 않습니까?
나는 didRotateFromInterfaceOrientation 방법 내의 ViewController 서브 클래스 중 하나에 발사하지에 문제가 있어요.
기본보기로 UISplitViewController가있는 iPad 앱이 있습니다. Detail 측면에서, 저는 게으른 뷰 전환을위한 "hidden"(툴바, navbar 없음) 네비게이션 컨트롤러를 사용하고 있습니다. didRotateFromInterfaceOrientation을 잡으려는 ViewController는 navcontroller 계층 구조의 두 단계 깊이입니다. (이 중에 차이를하지 않습니다해야하지만, 내가 모르는 어떤 특별한 경우가있을 경우이 정보를 포함하고있어 약)
내가 가진 :
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
// This doesn't work. :(
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
NSLog(@"Rotate Go!");
}
뷰가 잘 회전, 하지만 didRotateFromInterfaceOrientation은 결코 실행되지 않습니다.
내가 무엇을 놓치고 있는지 알 수 있습니까? 나는 내보기 여부를 감지하고있어
두UISplitViewController
대리자 메서드에서
, splitViewController:willHideViewController:withBarButtonItem:forPopoverController:
및 splitViewController:willShowViewController:invalidatingBarButtonItem:
: 이벤트가 발사되지 않은 이유를
uitabbar가 있습니까? 왜냐하면 uitabbar 클래스를 만들고이 클래스에서 "shouldAutorotateToInterfaceOrientation"을 구현하여 다른 모든 컨트롤러가 회전 메시지를 받도록해야하기 때문입니다. –
Nope. UIToolbar 및 UINavigationController (툴바가 숨겨져 있으므로 다른 뷰가 다른 툴바를 공유 함)와 함께 UISplitViewController를 사용하고 있습니다. 그러나 UITabBar는 없습니다 ... – DOOManiac
사과에 따르면, UISplitViewController는 응용 프로그램 창의 루트보기 여야합니다. 그럴리가 없으면 이상하게 느껴질 수 있습니다. 이 SO 스레드를 확인하십시오. http://stackoverflow.com/questions/2734016/uisplitviewcontroller-doesnt-autorotate –