将导航栏改为白色后,仍然变成灰色.为什么



我使用这段代码将导航栏上的"后退"按钮变成白色,但是它一直使它变成灰色。

[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];

我也试过这个:

[[UINavigationBar appearance] setTintColor:UIColorFromRGB(0xFFFFFF)];

我也试过(我发现它在另一个问题):

[[UINavigationBar appearance] setTintColor:[UIColor colorWithWhite:1.0 alpha:1.0]];

都不行!他们一直把它弄成灰色!如果我尝试红色/黑色/绿色或其他颜色,它们都可以,但白色总是变成灰色。

试试这样…

UINavigationController *controller= [[UINavigationController alloc]     
initWithRootViewController:YourViewController];
controller.navigationBar.tintColor = [UIColor whiteColor];

最新更新