/ Published in: Objective C
                    
                                        
RGBCOLOR() is defined at Three20.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect
{
NSLog(@"self.topItem.title = %@", self.topItem.title);
CGRect frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
UIImage *image = [UIImage imageNamed: @"background.png"];
[image drawInRect:frame];
UILabel *label = [[[UILabel alloc] initWithFrame:frame] autorelease];
[label setBackgroundColor:[UIColor clearColor]];
label.font = [UIFont boldSystemFontOfSize: 20.0];
//label.shadowColor = [UIColor colorWithWhite:1.0 alpha:1];
label.textAlignment = UITextAlignmentCenter;
label.textColor = RGBCOLOR(73, 81, 85);
label.text = self.topItem.title;
self.topItem.titleView = label;
self.tintColor = RGBCOLOR(229, 239, 246);
}
@end
Comments
 Subscribe to comments
                    Subscribe to comments
                
                