首页 > 解决方案 > UIImagePickerController Navigation Bar Tint Color not working with iOS 13

问题描述

I am presenting a modal controller which is a UIImagePickerController.

I am trying to change the UIImagePickerController navigation bars' tint colour.

Prior to iOS13 this worked fine;

imagePickerController.navigationBar.tintColor = .red

I have also tried;

imagePickerController.navigationController?.navigationBar.tintColor = .red

but still no joy.

What can I try next?

标签: swiftuinavigationbaruiimagepickercontrollerios13

解决方案


rmaddy 在评论中的解决方案解决了这个问题。

实施中AppDelegate

func configureGlobalUI() {
    UINavigationBar.appearance().tintColor = .red
}

然后打电话didFinishLaunchingWithOptions

这适用于我tintColor在所有navigationBar外观上的要求。


推荐阅读