Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS 7 UIImagePickerController Camera Covered with Static image
    primarykey
    data
    text
    <p><strong>iOS 7 using UIImagePickerController to take picture twice, at second time will show a static image covered the camera, how to reset the camera.</strong></p> <p>I'm try to take picture one by one, and keep take 5 pictures.</p> <p>It works on iOS6.</p> <p>on iOS7, it works fine at the first time, but <strong>when it take picture at second time, it will show a static dark image on screen, how to clear or reset it</strong>, although take picture works, but user can't see what will capture with camera.</p> <pre><code>bool fistTimeToShow = YES; -(void) viewDidAppear:(BOOL)animated{ if (fistTimeToShow) { fistTimeToShow = NO; self.imagePickerController = nil; [self tackImage]; } } -(void)tackImage{ if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { self.imagePickerController = [[UIImagePickerController alloc]init]; self.imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; self.imagePickerController.showsCameraControls = YES; self.imagePickerController.delegate = self; [self presentViewController:self.imagePickerController animated:NO completion:nil]; } } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ NSLog(@"====== imagePickerController:didFinishPickingMediaWithInfo ======"); [self.imagePickerController dismissViewControllerAnimated:NO completion:nil]; //...deal with the image capture... self.imagePickerController = nil; [self tackImage]; } </code></pre> <h2>Update</h2> <p>I change the dismiss function to put the <code>[self tackImage];</code> in block. And now it always show the fist image took.</p> <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ NSLog(@"====== imagePicker: didFinish ======"); self.imagePickerController = nil; [self dismissViewControllerAnimated:NO completion: ^{ [self tackImage]; }]; } </code></pre> <p>I'm trying to find a way to clear the image. But I don't know where the image saved yet.</p> <h2>Update2</h2> <p>use </p> <pre><code>[self performSelector:@selector(presentCameraView) withObject:nil afterDelay:1.0f]; </code></pre> <p>and function</p> <pre><code>-(void)presentCameraView{ [self presentViewController:self.imagePickerController animated:NO completion:nil]; } </code></pre> <p>to replace. <code>[self presentViewController:self.imagePickerController animated:NO completion:nil];</code> it works on my device anyway, but I don't even know why.</p> <h2>Update3</h2> <p>I have set the <code>userInteractionEnabled</code> to <code>NO</code> when <code>Delay:1.0f</code> to avoid other problems, and may be also need set the <code>navigationBar</code> and <code>tabBar</code> for specifically use. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload