作品链接:
http://www.jianshu.com/users/1e0f5e6f73f6/top_articles
1.通过setTintColor设置导航条文字的颜色
[bar setTintColor:[UIColor whiteColor]];
2.通过图片设置,在Images.xcassets里设置图片为非default
- 代码
// self -> 导航控制器
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if (self.viewControllers.count != 0) { // 非跟控制器 隐藏底部导航条
viewController.hidesBottomBarWhenPushed = YES;
// 设置导航条左边按钮的内容,把系统的返回按钮给覆盖,导航控制器的滑动返回功能就木有啦
viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"导航栏按钮的图片"] style:UIBarButtonItemStyleBordered target:self action:@selector(back)];
}
// 返回
[super pushViewController:viewController animated:animated];
}
- (void)back
{
[self popViewControllerAnimated:YES];
}