UIImagePickerController
should open in landscape? I tried using category but it is not working. how to fix orientation to a UIImagePickerController
?
Asked
Active
Viewed 69 times
-2

Viral Savaj
- 3,379
- 1
- 26
- 39
-
See the Link.. http://stackoverflow.com/questions/19374237/using-uiimagepickercontroller-in-landscape-orientation – Ashok Londhe May 14 '15 at 06:32
3 Answers
0
You should use UIPopoverController to display ImagePickerController in Landscape mode
-(void)showImagePicker:(id)sender
{
UIButton *button = (UIButton *)sender; // button is on which user will tap to show image picker
UIImagePickerController *imgPicker = [[UIImagePickerController alloc] init];
imgPicker.delegate = self;
imgPicker.allowsEditing = YES;
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.popover = [[UIPopoverController alloc] initWithContentViewController:imgPicker];
[self.popover presentPopoverFromRect:button.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}

Vizllx
- 9,135
- 1
- 41
- 79
0
The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing.

Santhosh Kumar
- 1
- 1
0
It's easy. Try to create a custom class of UIImagePickerController. Override supportedInterfaceOrientations method in it:
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL)shouldAutorotate{
return YES;
}

Ptah
- 906
- 1
- 12
- 25