objective-c – 如何在不需要时摆脱UIAppearance?

在我的AppDelegate中,我使用UIAppearance设置我自己的NavigationBar与此代码
[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"nav5.png"] forBarMetrics:UIBarMetricsDefault];

但是我的应用程序的一些看法不需要它.我如何摆脱它,所以我只能在有意见的视图中使用IB?

解决方法

您不需要使用代理.只要得到实际的导航栏,它应该看起来不一样,直接在它上面设置颜色.
[navigationBarInstance setTintColor:[UIColor blackColor]];
[navigationBarInstance setBackgroundImage:[UIImage imageNamed:@"nav5.png"] forBarMetrics:UIBarMetricsDefault];

您也可以将这两个值都设置为nil,再次选择标准样式. (由本克莱顿测试).

[navigationBarInstance setTintColor:nil];
[navigationBarInstance setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];

相关文章

本程序的编译和运行环境如下(如果有运行方面的问题欢迎在评...
水了一学期的院选修,万万没想到期末考试还有比较硬核的编程...
补充一下,先前文章末尾给出的下载链接的完整代码含有部分C&...
思路如标题所说采用模N取余法,难点是这个除法过程如何实现。...
本篇博客有更新!!!更新后效果图如下: 文章末尾的完整代码...
刚开始学习模块化程序设计时,估计大家都被形参和实参搞迷糊...