更新时间:2022-11-19 22:05:15
你做这件事的方式应该有效,但事实并非如此。这确实有效:
The way you are doing it is supposed to work, but it doesn't. This does work though:
UINavigationBar.appearance(whenContainedInInstancesOf: [YourOtherVC.self]).tintColor = .black
[[UINavigationBar appearanceWhenContainedIn:[YourOtherVC class], nil] setTintColor:[UIColor blackColor]];