Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImagePickerController avoiding the use/retry view after picture taken without disabling other controls

I'd like to avoid the use/retry view after the picture is taken without disabling the default Apple camera controls that let me take the picture.

Doing this:

imagePicker.showsCameraControls = NO;

Causes ALL the camera controls to disappear. Is there any other method?

like image 551
Andrew Lauer Barinov Avatar asked Apr 21 '12 02:04

Andrew Lauer Barinov


3 Answers

Unfortunately there is no proper way to do this provided by Apple. So here are you options:

  1. showCameraControls = NO and adding your own controls.
  2. go hardcore and use AVFoundation - but again you'll need your own controls - probably not what you're looking to do but if you're interested I have a sample app of this here:

https://github.com/Shein/CameraFeedUnderlay

  1. Hack around it - place YOUR OWN button on top of camera control play button and override the action to take the picture as you would without camera controls and directly dismiss the UIImagePickerController.

There's a sort-of example of this solution here:

iPhone SDK - How to disable the picture preview in UIImagePickerController?

like image 113
shein Avatar answered Nov 16 '22 11:11

shein


Perhaps this helps. You can use imagePicker.showsCameraControls = YES; in collaboration with NSNotificationCenter listening to @"_UIImagePickerControllerUserDidCaptureItem" and @"_UIImagePickerControllerUserDidRejectItem".

When entering the @"_UIImagePickerControllerUserDidCaptureItem" state, you could then dismiss the UIImagePickerController.

I had a similar problem, hiding a overlay when entering the preview view. I could solve the problem with this approach.

like image 36
jerik Avatar answered Nov 16 '22 10:11

jerik


You can customize an image picker controller to manage user interactions yourself. To do this, provide an overlay view containing the controls you want to display, and use the methods described in “Capturing Still Images or Movies.” You can display your custom overlay view in addition to, or instead of, the default controls. Custom overlay views for the UIImagePickerController class are available in iOS 3.1 and later by way of the cameraOverlayView property. For a code example, see the PhotoPicker sample code project.

from this you can create your own customCameraView to show your own controls that you need to show

like image 25
Bala Avatar answered Nov 16 '22 10:11

Bala