Objective c UI外观和UINavigationBar控制器

Objective c UI外观和UINavigationBar控制器,objective-c,ios,uinavigationcontroller,uiappearance,Objective C,Ios,Uinavigationcontroller,Uiappearance,我有我的UIBarButtonims和UINavigationBar的背景图像。我正在尝试使用UIAppearance通过以下内容对它们进行自定义: [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navbar.png"] forBarMetrics:UIBarMetricsDefault]; [[UIBarButtonItem appearance] setBackgroundImag

我有我的UIBarButtonims和UINavigationBar的背景图像。我正在尝试使用UIAppearance通过以下内容对它们进行自定义:

    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navbar.png"] forBarMetrics:UIBarMetricsDefault];
    [[UIBarButtonItem appearance] setBackgroundImage:[UIImage imageNamed:@"navbar_btn.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
而且效果很好。唯一的问题是UINavigationBar上的默认后退按钮仍然使用标准的iOS背景色/图像。当我在[UINavigationBar外观]上设置TintColor时,它将更改颜色,但这只需要UIColor

是否可以设置默认的导航后退按钮图像(无需手动更改每个viewcontroller)或将图像转换为UIColor

谢谢大家!

更新:答案如下


显然,UIBarButtonim有一个单独的backbutton自定义功能。我必须基于navbar_btn.png为后退按钮创建另一个图像,并使用以下方法进行设置:

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

显然,UIBarButtonim有一个单独的backbutton自定义功能。我必须基于navbar_btn.png为后退按钮创建另一个图像,并使用以下方法进行设置:

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

显然,UIBarButtonim有一个单独的backbutton自定义功能。我必须基于navbar_btn.png为后退按钮创建另一个图像,并使用以下方法进行设置:

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];