使用此方法更改后退导航按钮的标题和背景图像。标题已更改,但按钮保持黑色
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"topBarbackground.png"] forBarMetrics:UIBarMetricsDefault];
UIBarButtonItem *backButton = [UIBarButtonItem new];
[backButton setBackgroundImage:[UIImage imageNamed:@"backButton.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[backButton setTitle:NSLocalizedString(@"Back", nil)];
[[self navigationItem] setBackBarButtonItem:backButton];
}
这样做的正确方法是什么?