Ronak Ronak - 9 months ago 69
iOS Question

open UIImagePickerController in landscape mode

I want to open iphone saved images in my application. my application working in landscape mode. when I trying to load all saved photo from iphone library using presentModalViewController method, it will open in portrait mode. I want that in landscape mode. here is the code:

picker = [[UIImagePickerController alloc] init];
picker.delegate = self;

picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
picker.allowsEditing = NO;
picker.navigationBarHidden = YES;
picker.wantsFullScreenLayout = YES;
[picker setNavigationBarHidden:TRUE];

[self presentModalViewController:picker animated:NO];
NSLog(@"%@", self.view.subviews);
[picker release];

can any one help me..
Thanks in advance.

Answer Source

You can't. Quoth the documentation:

The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing.

It's a bit more work, but you can use the AssetsLibrary framework to access the list of images and create your own image picker.