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,104
  • 1
  • 16
  • 26
cdub
  • 22,735
  • 52
  • 164
  • 287

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,329
  • 9
  • 20
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
  • 5,827
  • 7
  • 47
  • 83
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,417
  • 2
  • 19
  • 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