Thursday, 8 August 2013

UIImagePickerController interfaceOrientation always come up as portrit

UIImagePickerController interfaceOrientation always come up as portrit

I am trying to capture the current orientation of the
UIImagePickerController being presented, and changing the overlay view's
hidden property accordingly.
if([notification.name
isEqualToString:@"UIDeviceOrientationDidChangeNotification"]) {
UIInterfaceOrientation orientation =
self.cameraImagePicker.interfaceOrientation;
if(orientation == UIInterfaceOrientationPortrait) {
self.cameraImagePicker.cameraOverlayView.hidden = NO;
} else {
self.cameraImagePicker.cameraOverlayView.hidden = YES;
}
}
However, orientation == UIInterfaceOrientationPortrait even if I rotate
the camera, but this method is called every time the device rotates.
Note: My application only supports portrait orientation according to the
project file, but rotation is somehow still supported by the
UIImagePickerController
Any help with this issue would be greatly appreciated!

No comments:

Post a Comment