1、返回按钮的颜色
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
2、设置返回按钮的内容
A -> B
在push的时候,在A中添加代码:
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
backItem.title = @
"你的文字"
;
self.navigationItem.backBarButtonItem = backItem;
3、自定义navigationBar按钮
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"全部已读" style:UIBarButtonItemStylePlain target:self action:@selector(allReadedTapped)];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"backIcon"] style:UIBarButtonItemStyleBordered target:self action:@selector(backButtonTouched:)];
4、自定义navigationBar的title内容和字体大小、颜色
self.title = @"登 录";
self.navigationController.navigationBar.titleTextAttributes = @{
NSFontAttributeName:[UIFont systemFontOfSize:17],
NSForegroundColorAttributeName:[UIColor whiteColor]
};
5、设置navigationBar的背景颜色
self.navigationController.navigationBar.barTintColor = [UIColor colorFromHexRGB:@"3bad6f" alpha:1.0f];
6、取消系统中navigationBar的自带的半透效果
self.navigationController.navigationBar.translucent = NO;