编辑:我是个白痴。您正在尝试设置样式,而不是颜色。以下是所有有效信息,但您几乎可以肯定想要的是由定义navigationBarStyle
的属性。对不起。TTViewController
Three20 内置了一个“样式表”机制,其预期目的是让您不必在应用程序中的所有 UI 对象上一遍又一遍地设置色调颜色、字体等。但是,如果您不知道它的存在,那么您最终会陷入这种情况。你需要做的是:
在您的应用程序中创建一个子类TTDefaultStyleSheet
,并至少覆盖此方法:
- (UIColor*)navigationBarTintColor {
return RGBCOLOR(119, 140, 168);
}
在您的应用程序中的某个地方(可能applicationDidFinishLaunching:
),调用:
[TTStyleSheet setGlobalStyleSheet:
[[[YourStyleSheetClass alloc] init] autorelease]];
(You might want to browse around in TTDefaultStyleSheet.h
, because there are a whole pile of other styles defined there that are used by the framework, and that you might also want to override.)