0

I've a view with UIImagePickerController..

In the whole application I have:

/* white color */
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

But in this case I need to view status bar black, so I set it:

/* black color */ 
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];

I've do this in delegate

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

But seems ignoring instruction.

Works only for iOS < 8. I've already read this question and other, but I can't make it work.

Community
  • 1
  • 1
Luca Davanzo
  • 19,947
  • 14
  • 113
  • 144

3 Answers3

0

Just change it from your xib / storyboad if you want to change for particular view means.

enter image description here

Rajesh Loganathan
  • 10,935
  • 4
  • 76
  • 89
0

Try like this while presenting UIImagePickerViewController:

[self presentViewController:imagePickerController animated:YES completion:^{
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
}];
Adeel Ur Rehman
  • 606
  • 5
  • 13
0

I resolved my problem in this way:

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];

if(IS_IOS8_AND_UP) {
    imagePickerController.modalPresentationStyle = UIModalPresentationFullScreen;
} else {
    imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
}

imagePickerController.delegate = self;
[self presentViewController:imagePickerController animated:YES completion:nil];

And then in delegate I set the default status bar style.

Hope this help!

Luca Davanzo
  • 19,947
  • 14
  • 113
  • 144