Ios7 无法为iOS 7中导航栏的右栏按钮添加不同的色调

Ios7 无法为iOS 7中导航栏的右栏按钮添加不同的色调,ios7,Ios7,我当前的应用程序运行在iOS 5和iOS 6上。导航栏为橙色,右侧栏按钮为灰色。此外,右栏按钮具有边框样式。然而,当我在iOS 7上运行相同的应用程序时,我观察到右栏按钮是透明的,并且与导航栏具有相同的橙色。请告诉我,是否有任何方法可以使导航栏和栏按钮项目看起来与之前iOS 5和iOS 6的情况几乎相同。提前谢谢。试试这个 [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_b

我当前的应用程序运行在iOS 5和iOS 6上。导航栏为橙色,右侧栏按钮为灰色。此外,右栏按钮具有边框样式。然而,当我在iOS 7上运行相同的应用程序时,我观察到右栏按钮是透明的,并且与导航栏具有相同的橙色。请告诉我,是否有任何方法可以使导航栏和栏按钮项目看起来与之前iOS 5和iOS 6的情况几乎相同。提前谢谢。

试试这个

[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bg"] forBarMetrics:UIBarMetricsDefault];


UIButton *listbtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
[listbtn setImage:[UIImage imageNamed:@"list"] forState:UIControlStateNormal];
[listbtn setBorderColor:[UIColor clearColor] withBorderWidth:0];
[listbtn setBackgroundColor:[UIColor clearColor]];
[listbtn addTarget:self action:@selector(leftDrawerButtonPress:) forControlEvents:UIControlEventTouchUpInside];
[self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithCustomView:listbtn]];