Please note that the answer below - do not work for iOS6 so I still need an answer!
My application is enabled only for Portrait mode.
However, if I embed a UIImagePickerController inside as a subview, and rotate the device, the top and bottom bar stays in the same location, however UIImagePickerController does rotate.
How can I prevent it from rotating?
This is the code:
[self.view.window addSubview:self.imagePickerController.view];
self.imagePickerController.showsCameraControls = NO;
self.imagePickerController.view.frame = CGRectMake(0, 90, 320, 320);
self.imagePickerController.allowsEditing = NO;
EDITED
I am using iOS6 where shouldAutorotate is not being calle
Add this UIImagePickerController
category in your class,
@interface UIImagePickerController(Nonrotating)
- (BOOL)shouldAutorotate;
@end
@implementation UIImagePickerController(Nonrotating)
- (BOOL)shouldAutorotate {
return NO;
}
@end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With