- (void)viewWillAppear:(BOOL)animated{app
[super viewWillAppear:YES];it
[self.navigationController.navigationBar setBarTintColor:[UIColor blackColor]];//导航栏背景色io
[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];//导航栏标题颜色im
[self.navigationController.navigationBar setBarStyle:UIBarStyleBlack];//状态栏颜色dict
}animate
- (UIStatusBarStyle)preferredStatusBarStyle{di
//设置状态栏前景色(须要与[self.navigationController.navigationBar setBarStyle:UIBarStyleBlack];组合使用)view
return UIStatusBarStyleLightContent;vi
}return
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:YES];
//本界面消失时 让导航栏啥的都还原
[self.navigationController.navigationBar setBarTintColor:[UIColor whiteColor]];//导航栏背景色
[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor],NSForegroundColorAttributeName,nil]];//导航栏标题颜色
[self.navigationController.navigationBar setBarStyle:UIBarStyleDefault];
}