<pre name="code" class="objc">naviEmptyBG为透明图(xcode6.3 ios8.3 oc语言)
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.navigationBar.shadowImage = [UIImage imageNamed:@"naviEmptyBG"];
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"naviEmptyBG"] forBarMetrics:UIBarMetricsDefault];
self.navigationController.view.backgroundColor = self.navigationController.navigationBar.barTintColor;
}
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.navigationController.navigationBar.shadowImage = [UIImage imageNamed:@""];
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics:UIBarMetricsDefault];
}