I was trying to implement a project with custom navigation bar; however, the following code:
@implementation UINavigationBar (CustomImage)
// Set the navigation bar background
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed:@"TopBar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height + 1)];
}
@end
is not working for iOS 5. I am using Xcode 4.2.
Question: How can I implement a custom navigation bar without compromising the use of the code above for earlier versions (< iOS 5)?
Any help would be appreciated. 🙂
I finally got it…this might help others implementing this.