0

In iOS 13 some things seem to have changed in terms of customizing the navigation bar appearance. I want to customize the navigation bar of a UIImagePickerController. According to iOS 13 guidelines the code to change an existing navigation bar (in this case changing the UIImagePickerController navigation bar background color to red) would be:

let imagePickerViewController = UIImagePickerController()
let barAppearance = UINavigationBarAppearance()
barAppearance.configureWithDefaultBackground()
barAppearance.backgroundColor = .red
imagePickerViewController.navigationBar.standardAppearance = barAppearance
imagePickerViewController.navigationBar.scrollEdgeAppearance = barAppearance

Unfortunately, this does not work. In general setting imagePickerViewController.navigationBar appearance does not have any influence on the presented UIImagePickerController.

The only thing that seems to be working is changing the default appearance of all UINavigationBars like this:

UINavigationBar.appearance().tintColor = .red

But this does not allow individual customization and does not allow for extending the navigation bar with your own UIBarButtonItems and other navigation bar elements.

I know that there are some questions on StackOverflow about this topic, but none of them has a working answer and none of them discusses if apple has made any changes in terms of general customizability of the UIImagePickerController. So here are my questions:

  • Did apple remove the option of customizing the navigation bar of an UIImagePickerController in iOS 13?
  • If not, how do you actually customize the navigation bar of an UIImagePickerController in iOS 13?
Wizard
  • 295
  • 1
  • 4
  • 15

1 Answers1

0

I tried too, but only UINavigationBar.appearance().tintColor = .red works just as you said.

Part of UIImagePickerController is running on a separate process (_UIRemoteView), may be that's why?

BumMo Koo
  • 1,119
  • 1
  • 8
  • 11