귀하의 질문은 막연합니다. 이것은 일반적인 설명입니다. 아래 방향을 언급 한 방법
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// return YES to supported orientation.
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
/* Subclasses may override this method to perform additional actions immediately
prior to the rotation. For example, you might use this method to disable view
interactions, stop media playback, or temporarily turn off expensive drawing or live
updates. You might also use it to swap the current view for one that reflects the new
interface orientation. When this method is called, the interfaceOrientation property
still contains the view’s original orientation.
*/
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
/*Subclasses may override this method to perform additional actions immediately after
the rotation. For example, you might use this method to reenable view interactions,
start media playback again, or turn on expensive drawing or live updates. By the time
this method is called, the interfaceOrientation property is already set to the new
orientation.*/
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
{
/*This method is called from within the animation block used to rotate the view.
You can override this method and use it to configure additional animations that should
occur during the view rotation. For example, you could use it to adjust the zoom level
of your content, change the scroller position, or modify other animatable properties
of your view.*/
}
이
if([UIDevice currentDevice].orientation == UIInterfaceOrientationLandscapeLeft)
OR if(UIInterfaceOrientationIsLandscape([UIDevice currentDevice].orientation))
같이있는 viewDidLoad 또는 viewDidAppear에서 장치의 방향을 확인하지 않기 때문에 많은 시간을 아래로 타는 동안
변경 처리하는 방법을 언급 대체 할 수 있습니다 아이폰/아이 패드가 탁자 위에 놓여진 것처럼 (나는 이것을 경험했다. 매우 불쾌한 이슈), 기대하지 않은 결과를 줄 것이다.
이 apple developer link은 처리 방향
에 대해 더 많은 정보를 줄 것이다
- (무효) willAnimateRotationToInterfaceOrientation : (UIInterfaceOrientation) toInterfaceOrientation 시간 : (NSTimeInterval)의 기간은 장치 방향 변경 – Narayana