设置导航栏的背景和阴影样式,可以通过以下代码实现:
`self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];`
`self.navigationController.navigationBar.shadowImage = [UIImage new];`
同时,设置导航栏的透明度为YES:
`self.navigationController.navigationBar.translucent = YES;
`self.navigationController.navigationBar.translucent = YES;
`[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];`
`[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor blackColor],NSFontAttributeName:[UIFont systemFontOfSize:19.0]}];`
设置导航栏的整体颜色:
`self.navigationController.navigationBar.tintColor = ColorGreen;
设置右边的返回按钮:
`self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"nav_masterBackButton"] style:UIBarButtonItemStylePlain target:self action:@selector(popSelfVC)];`