Search code examples
iosobjective-cuiimagepickercontrollerstatusbar

How to make UIImagePickerController StatusBar lightContent style?


enter image description here

When I present the ImagePickerController the statusBar text color is still black, how to make like this?


Solution

  • Just three steps:

    1: Add UINavigationControllerDelegate,UIImagePickerControllerDelegate to your

    @interface yourController ()<>
    

    2: imagePickerController.delegate = self;

    3:

    -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    }