UINavigationController 片集
1、设置导航栏标题的字体颜色和大小
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:19],NSForegroundColorAttributeName:[UIColor redColor]}];
self.navigationItem.titleView //设置导航栏的标题视图
[self.navigationBar setBackgroundImage:[UIImage imageWithColor:COLOR_WITH_RGB(
70
,
70
,
70
) size:CGSizeMake(SCREEN_WIDTH, KNav_Height)] forBarMetrics:UIBarMetricsDefault]; //设置导航栏颜色
self.navigationController.navigationBarHidden = YES; //隐藏navigationBar
2、设置全局导航条风格和颜色
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:23/255.0 green:180/255.0 blue:237/255.0 alpha:1]];
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];
3、设置导航栏左右侧按钮和返回按钮
self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithTitle:@"Edit" style:UIBarButtonSystemItemAdd target:nil action:nil];
UIBarButtonItem *back=[[UIBarButtonItem alloc]initWithTitle:@"QQ" style:UIBarButtonItemStyleDone target:nil action:nil];
self.navigationItem.backBarButtonItem=back;
3.2自定义左右导航项
UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
UIBarButtonItem *bar1 = [[UIBarButtonItem alloc] initWithCustomView:btn1];