0

I have a tab bar that calls a UIImagePickerController like so:

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

    [[UIApplication sharedApplication] setStatusBarHidden:YES];

    [self presentViewController:photo animated:YES completion:nil];

But the status bar remains even witht the setStatusBarHidden to YES.

Kanan Vora
  • 2,124
  • 1
  • 16
  • 26
cdub
  • 24,555
  • 57
  • 174
  • 303

3 Answers3

0

Try by implementing the following delegate method:

- (void)navigationController:(UINavigationController *)navigationController 
       didShowViewController:(UIViewController *)viewController
                    animated:(BOOL)animated {
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
}
Sylvain Guillopé
  • 1,358
  • 9
  • 21
0

Please go through following code

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {

   if([navigationController isKindOfClass:[UIImagePickerController class]]&& ((UIImagePickerController*)navigationController).sourceType == UIImagePickerControllerSourceTypeCamera)
   {
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
   }
}
IKKA
  • 6,297
  • 7
  • 50
  • 88
0

Go to your plist file in Xcode and this key to no

view controller-based status bar appearance' and set to NO., that did the trick for me

Geet
  • 2,427
  • 2
  • 21
  • 39
  • Yes true but not for the UIImagePicker, see http://stackoverflow.com/questions/18059703/cannot-hide-status-bar-in-ios7 – cdub Jul 22 '14 at 07:25