is it possible to use UIImagePickerController to fetch image from gallery without making whole app in portrait mode in iOS .Thanks
Asked
Active
Viewed 477 times
0
-
check out this answer : http://stackoverflow.com/questions/20743388/is-it-possible-to-show-uiimagepickercontroller-in-iphone-in-landscape-mode – Naga Mallesh Maddali Jun 25 '14 at 10:07
-
Problem solved by creating category class of NavigationController and adding function -(BOOL)shouldAutorotate { return NO; } – user3587934 Jun 25 '14 at 11:55
1 Answers
0
Create a custom class of UIImagePickerController. Override supportedInterfaceOrientations meted
- (NSUInteger) supportedInterfaceOrientations
{
//Because your app is only landscape, your view controller for the view in your
// popover needs to support only landscape
return UIInterfaceOrientationMaskAll;
}
-(BOOL)shouldAutorotate{
return yes;
}
//call custom view like this
CustomImagePickerViewController *picker = [[CustomImagePickerViewController alloc] init];
picker.supportedInterfaceOrientations= UIInterfaceOrientationMaskAll;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
[self presentViewController:picker animated:YES completion:nil];

user3663584
- 100
- 6
-
I'm new in this development Please Tell me how to create custom class of UIImagePickerController? – user3587934 Jun 25 '14 at 10:07
-
I tried it using category but it works for app having only one view controller but my app contains multiple view controllers. – user3587934 Jun 25 '14 at 10:11
-
Add new file --> objective c class select subclass of as UIImagePickerController give name and create – user3663584 Jun 25 '14 at 10:11
-
it doesn't work because we can't create subclass of UIImagePickerController – user3587934 Jun 25 '14 at 10:13