导航栏尽管变为白色但仍会变为灰色。为什么?

时间:2014-06-30 23:54:12

标签: objective-c uinavigationcontroller uinavigationbar uicolor

我使用此代码打开"返回"导航栏上的按钮变为白色,但它会一直变灰。

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

我也试过这个:

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

我也尝试过(我在另一个问题中找到了它):

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

它们都不起作用!他们一直把它变成灰色!如果我尝试红色/黑色/绿色或其他颜色,它们会起作用,但白色会变成灰色。

1 个答案:

答案 0 :(得分:0)

尝试这样......

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