UIImagePickerController in Landscape

PF1 picture PF1 · Jan 18, 2010 · Viewed 31.8k times · Source

I have been searching for an answer to this, but cannot come up with anything. Apparently, iPhone SDK 3.0 made it possible that UIImagePickerController can be displayed in landscape mode - but I am not finding any method that will allow this. I would think that if the application is in landscape by default it would automatically adjust the image controller, but that is not working for me.

Thanks for any help!

Answer

Arie Litovsky picture Arie Litovsky · Sep 23, 2014

No need to subclass; simply override the modalPresentationStyle property.

    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.modalPresentationStyle = UIModalPresentationFormSheet;
    [viewController presentViewController:picker animated:YES completion:NULL];