接手别人的代码,如果代码里用了UIAppearance进行了全局设置,你自己再个别设置就会不生效,比如
self.navigationController.navigationBar.tintColor = .white
应该会修改backBarButtonItem、leftBarButtonItem、rightbackBarButtonItem的颜色,但如果有代码
UINavigationBar.appearance().tintColor = .green
那么无论如何,都不会是白色。
接手别人的代码,如果代码里用了UIAppearance进行了全局设置,你自己再个别设置就会不生效,比如
self.navigationController.navigationBar.tintColor = .white
应该会修改backBarButtonItem、leftBarButtonItem、rightbackBarButtonItem的颜色,但如果有代码
UINavigationBar.appearance().tintColor = .green
那么无论如何,都不会是白色。