Objective c 更改导航栏外观

Objective c 更改导航栏外观,objective-c,ios,uinavigationcontroller,appearance,Objective C,Ios,Uinavigationcontroller,Appearance,我的应用程序流程:AViewController->BViewController->CViewController(通过navigationController)AViewController和CViewController看起来相同,只是BViewController看起来不同 我是这样做的: /// AppDelegate (should be 'super' settings) [[UINavigationBar appearanceWhenContainedIn:[ABCNavigat

我的应用程序流程:
AViewController->BViewController->CViewController
(通过navigationController)
AViewController
CViewController
看起来相同,只是
BViewController
看起来不同

我是这样做的:

/// AppDelegate (should be 'super' settings)
[[UINavigationBar appearanceWhenContainedIn:[ABCNavigationController class], nil] setBackgroundImage:theImage forBarMetrics:UIBarMetricsDefault];

/// BViewController (should apply ONLY to BViewController)
[self.navigationController.navigationBar setBackgroundImage:BImage forBarMetrics:UIBarMetricsDefault];
问题是,在
CViewController
中,我看到加载在
BViewController
中的图像,而不是在
appDelegate
中。如何将其还原为appDelegate设置


我应该强调,backgroundImage是我设置的许多元素之一,在这里举个例子。

CViewController
中尝试将导航栏的背景图像设置为
nil
视图中将出现
,因为它是由
BViewController
设置的

[self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];

它使backgroundImage完全消失,它不从appDelegate加载一个,而是从BViewController删除一个(并且不还原appDelegate一个)。我明白了。我以为你在所有的屏幕上都有默认的导航栏,除了bvc。然后简单地在AppDelegate中的C VC中设置背景图像。我给出了完整的解释和示例,说明我在A和C中设置了不同的图像。无论如何,感谢您的访问。你现在知道如何修复它了吗?你说“AViewController和CViewController看起来一样,只是BViewController看起来不同。”那么我会从app delegate中删除这一行,并在每个
ViewController
viewwillbeen
中设置导航栏的背景。但还写下我想恢复“AppDelegate”设置,给出了示例;)Nvm,这只是一个误会。至于现在,正如你所写的那样,我在B的“ViewWillExample”和“ViewDidEnglishe”中交换设置,但这不是一个好的解决方案。仍在寻找通过“[UINavigationBar appearancewhen containedin:]”实现的方法。谢谢你的建议。