-3

I have read a lot of similar answers but I'm still not able to get the white translucent navigation bar in iOS 10 and Objective C?

enter image description here

I tried with this:

[self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setValue:@(YES) forKeyPath:@"hidesShadow"];
self.navigationController.navigationBar.translucent = YES;
self.navigationController.view.backgroundColor = [UIColor whiteColor];

...But I'm getting a gray transparent navigation bar.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Iris Veriris
  • 448
  • 5
  • 7
  • 1
    Please provide an attempt of what you have tried. You are more likely to get a response that will be helpful to you if you have showed your efforts. – Lexi Nov 03 '17 at 12:22
  • 1
    Which part of the navigation bar documentation you didn't understand? – Desdenova Nov 03 '17 at 12:41
  • Please do a little research while posting question here, here is solution to your problem -> https://stackoverflow.com/questions/18897485/achieving-bright-vivid-colors-for-an-ios-7-translucent-uinavigationbar?rq=1 – Sucharu Hasija Nov 03 '17 at 13:16
  • I expeted there is a sligthly simpler/cleaner solution than the one mentioned in the answers above... – Iris Veriris Nov 03 '17 at 13:20

1 Answers1

0

You are setting the background of the navigation controller to a solid white color. Remove

self.navigationController.view.backgroundColor = [UIColor whiteColor];

from your code.

Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223