首页 > 代码库 > 设置导航条标题及背景图片

设置导航条标题及背景图片

#import "XMGNavigationViewController.h"@interface XMGNavigationViewController ()@end@implementation XMGNavigationViewController+ (void)load{    UINavigationBar *navBar = [UINavigationBar appearanceWhenContainedIn:self, nil];        // 只要是通过模型设置,都是通过富文本设置    // 设置导航条标题 => UINavigationBar    NSMutableDictionary *attrs = [NSMutableDictionary dictionary];    attrs[NSFontAttributeName] = [UIFont boldSystemFontOfSize:20];    [navBar setTitleTextAttributes:attrs];        // 设置导航条背景图片    [navBar setBackgroundImage:[UIImage imageNamed:@"navigationbarBackgroundWhite"] forBarMetrics:UIBarMetricsDefault];}

 

设置导航条标题及背景图片