overridden three20 TTDefaultStyleSheet style not working
- by funkadelic
hi,
i recently got three20 integrated into my app and am trying to override the default toolbar color in TTWebController.
In TTWebController.m:118 I see that this is setting the toolbar's tintColor:
_toolbar.tintColor = TTSTYLEVAR(toolbarTintColor);
So I created my own stylesheet that subclasses TTDefaultStyleSheet and overrides 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
and in my application:didFinishLaunchingWithOptions: i set my default stylesheet
[TTStyleSheet setGlobalStyleSheet:[[[FooStyleSheet alloc] init] autorelease]];
but when I view the TTWebController, it doesn't inherit my tintColor. If I edit TTDefaultStyleSheet.m directly:
- (UIColor*)toolbarTintColor {
return [UIColor blackColor];
}
it works as expected.
Is there something I am overlooking that is preventing my style to be picked up?
thanks,
-norm