UIToolbar tintColor和barTintColor问题

cdu*_*dub 7 uitoolbar uiview tintcolor ios ios7

我有这样的代码:

UIView *colorView = [[UIView alloc] init];
colorView.frame = CGRectMake(0.0, 0.0, self.view.frame.size.width, 64.0);
colorView.backgroundColor = [UIColor blackColor];
//colorView.tintColor = [UIColor blackColor];

UIToolbar *toolbar = [[UIToolbar alloc] init];
toolbar.frame = CGRectMake(0.0, 0.0, self.view.frame.size.width, 44.0);

self.view addSubview:colorView];
[self.view addSubview:toolbar];
Run Code Online (Sandbox Code Playgroud)

为什么工具栏子视图的颜色与我的视图不同?视图显示为黑色,工具栏显示为浅灰色?是否有模糊或导致此事的原因?

Bha*_*vin 8

某些属性的行为UINavigationBar已发生变化iOS 7.我已经在答案中解释了这个问题.

看看在酒吧风格iOS 6iOS 7:

在此输入图像描述


你可以在这里注意两点:

  1. 您可以更改栏样式translucent dark代替translucent light(默认).
  2. 您可以更改translucent属性NOYES(默认).