Вы можете компенсировать вращение вашего ipad, поворачивая вид наложения вашего UIImagePickerController. Во-первых, вы должны захватить уведомления, используя:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationCallback:) name:nil object:nil];
Тогда используйте этот код:
- (void) notificationCallback:(NSNotification *) notification {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
if ([[notification name] isEqualToString:@"UIDeviceOrientationDidChangeNotification"]) {
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
switch ( orientation ) {
case UIInterfaceOrientationLandscapeRight:
NSLog(@"LandcapeRight");
[UIView beginAnimations:@"LandscapeRight" context:UIGraphicsGetCurrentContext()];
[UIView setAnimationDuration:0.4];
m_uiCameraOverlayView.transform = CGAffineTransformIdentity;
[UIView commitAnimations];
break;
case UIInterfaceOrientationLandscapeLeft:
NSLog(@"LandscapeLeft");
[UIView beginAnimations:@"LandcapeLeft" context:UIGraphicsGetCurrentContext()];
[UIView setAnimationDuration:0.4];
m_uiCameraOverlayView.transform = CGAffineTransformTranslate(CGAffineTransformMakeRotation(M_PI), 0, 0);
[UIView commitAnimations];
break;
case UIInterfaceOrientationPortraitUpsideDown:
NSLog(@"UpsideDown");
[UIView beginAnimations:@"UpsideDown" context:UIGraphicsGetCurrentContext()];
[UIView setAnimationDuration:0.4];
m_uiCameraOverlayView.transform = CGAffineTransformTranslate(CGAffineTransformMakeRotation(-M_PI / 2), -128, -128);
[UIView commitAnimations];
break;
case UIInterfaceOrientationPortrait:
NSLog(@"Portrait");
[UIView beginAnimations:@"Portrait" context:UIGraphicsGetCurrentContext()];
[UIView setAnimationDuration:0.4];
m_uiCameraOverlayView.transform = CGAffineTransformTranslate(CGAffineTransformMakeRotation(M_PI / 2), 128, 128);
[UIView commitAnimations];
break;
default:
NSLog(@"????");
break;
}
}
}
}