Andrew Lauer Barinov
Andrew Lauer Barinov

Reputation: 5754

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?

Upvotes: 6

Views: 9856

Answers (3)

jerik
jerik

Reputation: 5767

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.

Upvotes: 7

shein
shein

Reputation: 1844

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?

Upvotes: 9

Bala
Bala

Reputation: 2895

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

Upvotes: 4

Related Questions