Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8104563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:53:09+00:00 2026-06-05T23:53:09+00:00

I have bug with UIImagePickerController which source type is camera. Sometimes after controller appeared,

  • 0

I have bug with UIImagePickerController which source type is camera. Sometimes after controller appeared, shutter is not opens up and I can’t to see a camera video signal, but photo taken is correct.
enter image description here

May be I doing something wrong? Code:

    if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]){

            UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
            cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
            cameraUI.allowsEditing = NO;
            cameraUI.showsCameraControls = NO;
            cameraUI.delegate = self;

            NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"OverlayView" owner:self options:nil];
            UIView *controlsView = [nibObjects objectAtIndex:0];

            CGRect overlayViewFrame = cameraUI.cameraOverlayView.frame;
            CGRect controlsFrame = CGRectMake(0.0, CGRectGetHeight(overlayViewFrame) - 54.0,
                                         CGRectGetWidth(overlayViewFrame), 54.0);

            controlsView.frame = controlsFrame;
            [cameraUI.cameraOverlayView addSubview:controlsView];

            [self presentModalViewController: cameraUI animated: YES];            
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:53:11+00:00Added an answer on June 5, 2026 at 11:53 pm

    The same was happening to me after locking/unlocking the app, it looks like the shutter opens on viewDidAppear.

    So, I subscribed my parent view controller to UIApplicationDidBecomeActiveNotification and re-execute manually the viewWillAppear and viewDidAppear methods of the controller containing the UIImagePickerController

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(applicationBecomeActive)
                                                 name:UIApplicationDidBecomeActiveNotification
                                               object:nil];
    
    .
    . 
    .
    
    - (void)applicationBecomeActive {
        if (imagePicker_)
            [imagePicker_ openShutter];
    }
    

    And then on the controller containing the UIImagePickerController

    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
        [imagePickerController_ viewWillAppear:animated];
    }
    - (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
        [imagePickerController_ viewDidAppear:animated];
        imagePickerController_.cameraFlashMode = cameraFlashMode_;
        imagePickerController_.cameraDevice = cameraDevice_;
    }
    - (void)openShutter {
        [imagePickerController_ viewWillAppear:YES];
        [imagePickerController_ viewDidAppear:YES];
    }
    

    PS: If you try this, don’t forget to remove the observer

    [[NSNotificationCenter defaultCenter] removeObserver:self];
    

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bug in my code somewhere but can't see what I have
We have a bug in our application that does not occur every time and
I have this weird bug that I cannot fix. Can anyone help me? Thank
How can I apply code changes to my running website, if I have bug
I have a bug which makes my website freeze in PHP. It occurs on
I have a bug which is caused by fragmented packets. I would like test
I have a bug on my site which only appears in MSN Explorer. The
This is homework...I'm not asking for answers, I just have a bug I'm not
I have a bug in my application that i'm not able to find. I
I have a bug. In WinForm .NET2.0 application my HeavyFunction can be called from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.