0

I have an iPhone-only app. It allows users to capture videos using the default UIImagePickerController.

When you run the app on an iPad 2 running iOS 7, the UIImagePickerController does not show the "swap camera" button in the upper right-hand corner. This is the button that allows the user to switch between the front-facing and rear-facing cameras. I have no idea why the button is not there. The button is there on iPhone and on iPad 3. The problem only happens on iPad 2. See attached screenshot.

Weird behavior - if you rotate the iPad to landscape mode, and tap where the button is supposed to be, it actually switches to the front facing camera. So the functionality is there, but for some reason the button is not visible.

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
picker.allowsEditing = YES;
picker.videoMaximumDuration = 1800;
picker.videoQuality = UIImagePickerControllerQualityTypeMedium;
[self.navigationController presentViewController:picker animated:YES completion:nil];
[picker release];

Image here:

https://i.stack.imgur.com/9idbv.jpg

1 Answers1

0

The UIImagePickerController only works on portrait, so you have to make a workaround to handle the orientation switch, like subclassing the UIImagePickerController, and changing the view when the orientation changes.

Credits: https://stackoverflow.com/a/21484101/736384

Community
  • 1
  • 1
Luis Ascorbe
  • 1,985
  • 1
  • 22
  • 36