1.1当设置导航栏颜色的时候:
self.navigationController.navigationBar.barTintColor = [UIColor redColor];
self.view.backgroundColor = [UIColor redColor];
会造成颜色差异
1.2.解决方法:关闭毛玻璃效果
(1)单个界面
self.navigationController.navigationBar.translucent = NO;
(2)全局
[UINavigationBar appearance].translucent = NO;
(3)显示效果
2.1隐藏导航栏下边的线
(1)方法(设置空UIImage)
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[UIImage new]];
(2)方法(隐藏底线)
self.navigationController.navigationBar.subviews[0].subviews[0].hidden = YES;
(3)显示效果