iOS change document picker status bar color not change

740 views Asked by At

My init ViewController will show status bar tint color with white color.

I need click the AlertertAction, presentViewController my UIDocumentPickerViewController status bar tint color will changed the the black color.

 ...
   cloudAction = [UIAlertAction
               actionWithTitle:@"from cloud"
               style:UIAlertActionStyleDefault
               handler:^(UIAlertAction * action)
               {
                 [UINavigationBar appearance].tintColor = [UIColor blackColor];
                     [self presentViewController:cloudPicker animated:YES completion:nil];
                }];
 ...

And My viewwillappear method set

 -(void) viewWillAppear:(BOOL)animated{
          [super viewWillAppear:animated];

              [UINavigationBar appearance].tintColor = [UIColor whiteColor];

      }

it is very strange. When I click the alert, show my cloud picker(UIDocumentPickerViewController) , the stats tint color still whiteColor(on UIDocumentPickerViewController), then click the picker cancel, my view controller changed the black color, not the white color.

Have anyone known how to change the color when I click the alert action , the pick stats bar tint color changed(changed to black color), and dismiss picker , my view controller still white color at status bar tint color.

thank you very much.

1

There are 1 answers

0
Bdar On

Have you tried changing UINavigationBar's titleTextAttributes?

UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.black]