1

As the title said, after I use self.edgesForExtendedLayout = UIRectEdgeNone;, I want to set the navigation bar to transparent. I use the code like this:

[self.navigationController.navigationBar setBackgroundImage:[UIImage new]
                                              forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
self.navigationController.navigationBar.shadowImage = [UIImage new];

But it doesn't work. The navigation bar is shown black. How should I make the navigation bar transparent?

My IOS page screenshot

ndmeiri
  • 4,979
  • 12
  • 37
  • 45
phnix
  • 135
  • 1
  • 7
  • You're setting a solid background image for the navigation bar, so why would you think it would be transparent afterwards? Also, this functionality is different on iOS7 and iOS8, as on iOS8 transparent navigation bars are default. – Claus Jørgensen Jul 04 '15 at 13:33
  • @ClausJørgensen it is not solid background image, i use the code in this [link](http://stackoverflow.com/questions/19082963/how-to-make-completely-transparent-navigation-bar-in-ios-7), if i comment `self.edgesForExtendedLayout = UIRectEdgeNone;` , that will be completely transparent. but the view will under navigation bar. – phnix Jul 04 '15 at 14:52
  • You really need to specify which version of iOS you're using. What you just said is not true for iOS8. – Claus Jørgensen Jul 04 '15 at 14:58

0 Answers0