는이 같은 회전 할 뷰의의 viewDidLoad 방법에 관찰자 추가하기 :
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter]
addObserver:self selector:@selector(orientationChanged:)
name:UIDeviceOrientationDidChangeNotification
object:[UIDevice currentDevice]];
다음 당신이 이 같은 방법 orientationChanged 내에서 변경하려는 뷰에 따라 뷰 설정 : 아이폰 OS 6에서
- (void) orientationChanged:(NSNotification *)note{
UIDevice * device = [UIDevice currentDevice];
switch(device.orientation)
{
case UIDeviceOrientationPortrait:
break;
case UIDeviceOrientationPortraitUpsideDown:
break;
case UIDeviceOrientationLandscapeLeft:
break;
case UIDeviceOrientationLandscapeRight:
break;
default:
break;
};
}
하나의보기 컨트롤러가있는 경우에도 동일합니까? –