overridden three20 TTDefaultStyleSheet style not working

Posted by funkadelic on Stack Overflow See other posts from Stack Overflow or by funkadelic
Published on 2010-05-05T00:20:38Z Indexed on 2010/05/05 0:28 UTC
Read the original article Hit count: 856

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

© Stack Overflow or respective owner

Related posts about three20

Related posts about iphone