Hi,
I am trying to create a UINavigationController with a background Image...
I have the following code at the top of the class where I implement the UINavigationController.
@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect {
UIImage *img = [UIImage imageNamed:@"header.jpg"];
[img drawInRect:CGRectMake(0, 0, self.frame.size.width,self.frame.size.height)];
}
@end
Then, inside my @implementation of my controller in the "viewDidLoad" function, I have the following...
MainViewController *controller = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:controller];
self.navController = nav;
[nav release];
I know I am close, because everything is working almost perfectly, except the image is 150px in height, and it's being squished down to a smaller size (doing a log of self.frame.size.height is giving me 44.0000) but is pushed down a certain number of pixels from the top...
I know I am close, but if anyone could help me out, it would be muchly appreciated.
Thank you,
--d