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