I needed a completely transparent navigation bar for the mapView so I did this:
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[UIImage new]];
That returns the desired effect, as seen here:
Now I have a problem when I go to any other because my navigationBar remains transparent:
How do I restore default settings of the navigationBar's backgroundImage and shadowImage?
by the way, you get get the original background image by using function
and store the image somewhere, then you use
to set it back,but most time, set to nil will solve your problem.
For Swift 3:
Set nil for image of navigation Controller on
viewWillDisappear
on map viewSet this two method in your mapview
MapView.m