全局隐藏
[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];或者[UINavigationBar appearance].clipsToBounds = YES;
局部隐藏
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];[self.navigationController.navigationBar setShadowImage:[UIImage new]];或者self.navigationController.navigationBar.clipsToBounds=YES;