且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS 5:您可以覆盖特定类中的UIAppearance自定义吗?

更新时间: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



Objective-C



Objective-C

[[UINavigationBar appearanceWhenContainedIn:[YourOtherVC class], nil] setTintColor:[UIColor blackColor]];