2010-06-29 6 views

답변

2

"return yes"는 "return no"이면 방향이 변경되지 않습니다. 방향이 바뀌지 않습니다.

- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) orientation 
{ 

return YES; 

} 

모두 최고입니다. ,

- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 
    if (toInterfaceOrientation == UIDeviceOrientationUnknown || toInterfaceOrientation == UIDeviceOrientationFaceUp || toInterfaceOrientation == UIDeviceOrientationFaceDown) { 
     // do something here for these orientations 
    } 
    else { 
     // do something else for the remaining orientation types 
    } 
} 
+0

이것은 모든 방향으로 자동 회전하므로 앱의 목표입니다. 오리 엔테이션을 제한하려면 주어진 오리엔테이션 (인수)이 [these] (http://developer.apple.com/iphone/library/documentation/uikit/reference/UIApplication_Class/) 중 하나와 같은지 여부를 반환 할 수 있습니다. Reference/Reference.html # // apple_ref/doc/uid/TP40006728-CH3-SW5). –

0

당신은 -willRotateToInterfaceOrientation:duration: 방법을 재정 의하여 예를 들어 크기를 조정 논리 또는 위치보기를 추가 할 수 있습니다, 귀하의 질문의 두 번째 부분에 응답하려면 내 상위 계층 뷰 컨트롤러의 willRotateToInterfaceOrientation에 ... ...보기 컨트롤러가 메시지를 수신하지 않을 수 있습니다 최상위 계층 뷰 컨트롤러에서

을 : 기간 : 메시지 willRotateToInterfaceOrientation를 통과해야합니다 기간 :, 나는이 포함 라인 ... (frameViewController

0

를보기 컨트롤러가 상층 뷰 컨트롤러가 아닌 경우 :

관련 문제