I was looking for a way to change my background image NavigationBarand control my appearance NavigationBarwhen a user navigates to the application.
I understand that the accepted approach for changing the background image is:
@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed: @"navbar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
However, this changes the look of NavigationBarthe entire application. How to change the background image NavBarwhen the user switches from one view to another?
Thanks in advance for your help!
source
share