4
我最近得到了three20集成到我的应用程序,并试图覆盖TTWebController中的默认工具栏颜色。覆盖three20 TTDefaultStyleSheet风格不起作用
在TTWebController.m:118我看,这是设置工具栏上的tintColor:
_toolbar.tintColor = TTSTYLEVAR(toolbarTintColor);
所以我创建了自己的样式表的子类TTDefaultStyleSheet和覆盖toolbarTintColor
FooStyleSheet.h:
#import <Three20Style/Three20Style.h>
#import <Three20Style/TTStyleSheet.h>
#import <Three20Style/TTDefaultStyleSheet.h>
@interface FooStyleSheet : TTDefaultStyleSheet
@property (nonatomic, readonly) UIColor* toolbarTintColor;
@end
FooStyleSheet.m:
#import "FooStyleSheet.h"
@implementation RaptrStyleSheet
- (UIColor*)toolbarTintColor {
return RGBCOLOR(0, 0, 0); // should override TTDefaultStyleSheet
}
@end
,并在我的应用中:didFinishLaunchingWithOptions:设置我的默认样式
[TTStyleSheet setGlobalStyleSheet:[[[FooStyleSheet alloc] init] autorelease]];
但是当我查看TTWebController,它不会继承我的tintColor。如果我直接编辑TTDefaultStyleSheet.m:
- (UIColor*)toolbarTintColor {
return [UIColor blackColor];
}
它按预期工作。
有什么我可以忽略,是阻止我的风格被拾起?
感谢,
范数
嗨funkadelic,你找到了你的问题的答案? – 2011-08-29 20:23:41