2011-10-28 2 views

답변

3

를 사용하여 회전을 제어하기 위해이 대리자 메서드,

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) 
    { 
     // Return YES for supported orientations 
     return YES; 
    } 
    else 
    { 
     return NO; 
    } 
} 

지원하려는 방향에 대한 대가 YES와 NO 다른 사람을 위해. 모든 뷰 컨트롤러에서이를 구현할 수 있습니다.

1

UIViewControllershouldAutorotateToInterfaceOrientation: 메서드를 구현할 수 있습니다. 지정된 뷰 컨트롤러에서 지원할 방향에 대해 YES을 반환하면 원하는 결과가 나타납니다.

the UIViewController docs을 참조하십시오.

관련 문제