В начале вашего AppDelegate
подкласса UINavigationBar
, как показано ниже:
@interface CustomNavBar : UINavigationBar
@end
@implementation CustomNavBar
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed:@"bar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
, а затем в AppDelegate
сделать эту магию:
//Set custom NavigationBar
[self.navController setValue:[[CustomNavBar alloc]init] forKeyPath:@"navigationBar"];
//Set tint to match bar.png
self.navController.navigationBar.tintColor = [UIColor colorWithRed:0.93 green:0.43 blue:0 alpha:1];
//Set font for NavigationBar
[self.navController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"Comfortaa-Bold" size:20], UITextAttributeFont, nil]];
Это должно дать вам гораздо больше контроля над UINavigationController
внешним видом.