0

시작 화면 직후 뷰는 장치 방향으로 제시되어야하지만 제시된 다른 방향으로 자동 회전하지 않아야합니다. 이 코드를 사용했습니다 :iPhone에서 자동 회전하지 않고 모든 방향 지원

이것은 iPad에서는 잘 작동하지만 iPhone에서는 shouldAutorotate에 대해 NO로 설정하면 세로로만 표시됩니다. 이것은 정상적인 행동입니까? 그렇다면 특정 뷰 컨트롤러에 대해서만 iPhone에서 자동 회전없이 모든 방향을 어떻게 지원할 수 있습니까?

switch (orientation) { 
    case UIDeviceOrientationLandscapeRight: 
     return UIInterfaceOrientationLandscapeLeft; 
    default: 
     return UIInterfaceOrientationLandscapeRight; 
} 

지금 글로벌 액세스를 위해 어딘가에 저장하고 있음을 반환 :

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; 

가 인터페이스 방향으로 그 변환 :

답변

0

당신은 당신이 시작할 때 장치에 어떤 방향을 감지 할 필요가 :

- (UIInterfaceOrientationMask) supportedInterfaceOrientations { 
    return globalOrientation; 
} 
관련 문제