Здесь уже слишком поздно, чтобы ответить, но я расширяю ответ @Adam Woś,
Перед предъявлением UIImagePickerController
,
UIImagePickerController *controllerObject = [[UIImagePickerController alloc] init];
...
...
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:)name:UIDeviceOrientationDidChangeNotification object:nil];
...
...
[self presentViewController:controllerObject animated:YES completion:nil];
- (void)orientationChanged:(NSNotification *)notification{
[self adjustViewsForOrientation:UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]];
}
- (void) adjustViewsForOrientation:(UIInterfaceOrientation)orientation
{
if(orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight)
{
NSLog(@".....landscape.....");
}
else if(orientation == UIDeviceOrientationPortrait || orientation == UIDeviceOrientationPortraitUpsideDown)
{
NSLog(@".....portrait.....");
}
}
Когда UIImagePickerController
получи увольнение, не забудь,
[[NSNotificationCenter defaultCenter]removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
Также обратите внимание, что согласно @FelixLam комментарию к ответу @Adam Woś,
если ориентация устройства заблокирована, уведомления больше не публикуются.
Чтобы справиться с этой ситуацией, необходимо реализовать CoreMotion
(альтернатива UIAccelerometer
iOS <6.0), чтобы определить, заблокирована или нет ориентация устройства. Вот блог для <code>UIAccelerometer http://blog.sallarp.com/iphone-accelerometer-device-orientation/, и это для CoreMotion
https://github.com/tastyone/MotionOrientation Вам придется нажать некоторую логику, чтобы проверить это.
Удачи!