2013-08-05 3 views
4

iPad 응용 프로그램의 경우 가능한 두 방향을 지원하기 위해 가로 모드 (세로 모드가 아닌)로 화면을 자동 회전 할 수 있습니다. 그러나 사용자가 흔들 필요가 있고 iPad를 방향과 방향으로 움직여야하는 응용 프로그램의 일부가 있습니다. 자동 회전 기능이 실행되지만 그렇지 않아야합니다.일시적으로 자동 화면 회전 비활성화

앱의이 섹션을 입력 할 때 방향이 고정되고 종료 할 때 잠금이 해제되도록 자동 맞춤을 비활성화하거나 다시 활성화 할 수 있습니까? 특정 부분이 다른보기 컨트롤러 수단 경우

답변

1

, YES가 ..

단지 제어기 코드 줄을 추가 할 수있다

// which orientation that this view controller support 
- (NSUInteger)supportedInterfaceOrientations 
{ 
    return UIInterfaceOrientationMaskPortrait; 
} 

// prevent rotation 
- (BOOL)shouldAutorotate 
{ 
    return NO; 
} 

// after present this view controller, which orientation do you prefer ? 
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation 
{ 
    return UIInterfaceOrientationPortrait; 
} 
+1

이 응답을 활성화하라는 요청을 해결하기 위해 나타나지 않으며 화면 회전 잠금 해제 –

관련 문제