Leo Leo - 10 months ago 66
iOS Question

iOS 9 UIImagePickerController statusBar white

The target screenshot want

First,I have read those link

All of the links use those API of

- setStatusBarStyle:animated:
- setStatusBarHidden:withAnimation:

But,those API are deprecated in iOS 9.

So,how to get lightContent statusBar in iOS 9?

Leo Leo
Answer Source

I figure it out,just post my answer. Accept any better answer

  1. Set View controller-based status bar appearance to YES,or just delete this key in info.plist
  2. Make a subclass of UIImagePickerController

    @interface BaseImagePickerController : UIImagePickerController
    @implementation BaseImagePickerController
        return UIStatusBarStyleLightContent; 
  3. Use this subclass

    self.imagePikerViewController = [[BaseImagePickerController alloc] init];