UINavigationController (drawRect:)

Posted by ludo on Stack Overflow See other posts from Stack Overflow or by ludo
Published on 2010-04-01T03:44:58Z Indexed on 2010/04/01 3:53 UTC
Read the original article Hit count: 320

Hi,

I created an application with a TabBarController, 4 TabBarItems and every TabBarItem have is own NavigationController file (everything created in IB).

I'm using the drawRect function to design my navigationBar:



@implementation UINavigationBar (customImage)

-(void)drawRect:(CGRect)rect {

  UIImage *image = [UIImage imageNamed:@"MyImage.png"];
  [image drawInRect:CGRectMake(0,0, self.frame.size.width,self.frame.size.height)];

}

@end

The problem is that the NavigationBar change for every ViewController inside my app, what I want is only draw the NavigationBar for one TabBarItem only and use the default navigationBar for other controller.
How to do that?

Thanks,

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone