On a communityapp development, I have the task of making an iPhone app into an iPad app.
Following the documentation, I used the following code to spawn my camera view :
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
self.imagePickerController = [[UIImagePickerController alloc] init];
self.imagePickerController.delegate = self;
self.imagePickerController.sourceType = sourceType;
if (sourceType == UIImagePickerControllerSourceTypeCamera) {
if ([UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront]) {
self.imagePickerController.cameraDevice = UIImagePickerControllerCameraDeviceFront;
}
self.imagePickerController.allowsEditing = YES;
self.imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
}
popover = [[UIPopoverController alloc] initWithContentViewController:self.imagePickerController];
[popover presentPopoverFromRect:self.profilePicture.frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
return;
}
But when spawned, I get this annoying "extra ghostly" camera button...
It doesn't work, and seems only to taunt me.
If I ask the object to hide its input buttons, ALL buttons disappear. I see no way of being able to tell that specific button to sod off.
I discovered it's only there the first time. If I close and reopen the popover, it's gone...
Sadly, this appears to be a bug in iOS 6 itself. There are a few possible workarounds, however.
You can set the showsCameraControls
property of the image picker to false. This will remove the ghostly image, but, the other controls will be removed as well. You'll have to write your own view with buttons and whatnot to call the correct actions.
You say if you close and reopen the popover, the button goes away. It may be possible for you to set the showsCameraControls
property of the picker to false, and then back to true before the picker is displayed. If it doesn't work, try creating a sort-of fake open/close action when the picker is initialized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With