2016-04-01 9 views
0

アップルのドキュメント。 "これは、インターフェイスを離れることなく複数の写真を撮ることをサポートしていますが、デフォルトの画像ピッカーコントロールを隠す必要があります。UIImagePickerControllerはdidFinishPickingMediaWithInfoで終了します

[self.imagePicker takePicture]デリゲートdidFinishPickingMediaWithInfoが呼び出されていますが、まだインターフェイスを離しています。 どのように私はコントローラが却下されるのを防ぐことができますか?ここにカスタムオーバレイを持つUIImagePickerControllerの私のコードです。

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; 
imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext; 
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; 
imagePicker.showsCameraControls = NO; 
CameraOverlayView *overlay = (CameraOverlayView *)[self viewWithNibName:@"CameraOverlayView" owner:self]; 
overlay.frame = imagePicker.cameraOverlayView.frame; 
imagePicker.cameraOverlayView = overlay; 
overlay.imagePicker = imagePicker; 
[self presentViewController:imagePicker animated:YES completion:nil]; 
overlay = nil; 

答えて

-1
// may be it will help for you. 
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { 
    // if you want to dismiss controll then use the following code 
    [picker dismissViewControllerAnimated:YES completion:^{ 

       }]; 
    // if you wnat to being present it comment the above dismis code 
} 
0

私は同じ問題を抱えているが、私は私がイメージピッカーを解雇せずに複数の画像を選択することができ、これを使用することにより、私のコードUzysAssetsPickerController for iOS

でこれらのクラスを使用してこれを解決しました。これが役立つことを願っています。

+0

これは複数の画像を選択するためのものです。ここでは複数の画像を撮影することを話しています。 – Machete

+0

よろしくお願いします。あなたはカメラから画像を撮ることについて話していますか?右? –

+0

写真を撮ることによって、カメラで複数の画像をキャプチャすることを意味しました。カメラロールまたは保存したアルバムから選択するだけではありません。 – Machete

0

これは私の問題を解決しました。完全に今働いています。みなさんありがとう。

<UIImagePickerControllerDelegate,UINavigationControllerDelegate> 
@property(nonatomic,strong) UIImagePickerController *imagePicker; 
overlay.imagePicker = _imagePicker; 
overlay.imagePicker.delegate = overlay; 
関連する問題