2012-08-09 2 views
1

내 rootViewController에서 shouldAutorotateToInterfaceOrientation 같은 것을 다시 구현했습니다. ios dev - shouldAutorotateToInterfaceOrientation 메서드가 세로 모드 용으로 호출되지 않았습니다.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    switch (toInterfaceOrientation) { 
     case UIInterfaceOrientationPortrait: 
      NSLog(@"Orientation - Portrait"); 
      break; 
     case UIInterfaceOrientationLandscapeLeft:   
      NSLog(@"Orientation - Left"); 
      break; 
     case UIInterfaceOrientationLandscapeRight: 
      NSLog(@"Orientation - Right"); 
      break; 
     case UIInterfaceOrientationPortraitUpsideDown: 
      NSLog(@"Orientation - UpsideDown"); 
      break; 
     default: 
      break; 
    } 
    return YES; 
} 

내 장치를 회전

,이 방법은 아닌 세로 방향으로, LandscapeRight, LandscapeLeft 및 상하 반전 호출됩니다.

보기가 세로 모드이며이 메서드는 UIInterfaceOrientationPortrait와 함께 호출됩니다. 그러나 장치를 회전시킬 때이 방법은이 방향에서만 호출되지 않습니다.

답변

0

shouldAutorotateToInterfaceOrientation은 일반적으로 호출자에게 응용 프로그램이 지원할 방향 (모든 값에 대해 ORed 값 또는 YES)을 지정하기 위해 한 번만 호출됩니다. 새 오리엔테이션을 표시하기 전에 오리엔테이션을 확인하거나 재배치를 수행하려면 willRotateToInterfaceOrientation:duration:을 찾고있을 수 있습니다.

+0

모든 인터페이스를 회전시키지 않고 메인보기에서 중앙 UIImageView를 회전하고 싶습니다. – Steven

관련 문제