1. ViewController 에서 shouldAutorotateToInterfaceOrientation 를 재정의 한다. 기본적으로 다음과 같이 재정의 되어있다.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

YES 를 반환할 경우 모든 방향으로 회전이 된다.

방향상수

1. UIInterfaceOrientationPortrait: 세로. 기본상태
2. UIInterfaceOrientationPortraitUpsideDown: 세로. 아래쪽이 위를 향하게 뒤집힘.
3. UIInterfaceOrientationLandscapeRight: 가로. 우측면이 위로 향함.
4. UIInterfaceOrientationLandscapeLeft: 가로. 좌측면이 위로 향함.
 

 

 2. 회전시 처리
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
 

'Mobile > iOS' 카테고리의 다른 글

[iOS] boolean type  (0) 2012.02.17
[iOS] Multitasking  (0) 2012.02.17
[iOS] Gesture Recognizer  (0) 2012.02.16
[iOS] Touches  (0) 2012.02.16
[iOS] 키보드 숨기기  (0) 2012.02.08

+ Recent posts