0

I searched and tried as below, but doesn't work. In fact, event set translucent = YES can't make the navigation bar translucent.Does anyone know?

self.navigationController.navigationBar.tintColor = [UIColor blueColor];
self.navigationController.navigationBar.alpha = 0.7f;
self.navigationController.navigationBar.translucent = YES;
Suge
  • 2,808
  • 3
  • 48
  • 79
  • 1
    did you try to set the transparency via the attributes inspector? here is a link to a [similar question](http://stackoverflow.com/questions/21181499/navigation-bar-becomes-transparent-when-set-to-translucent/21182784#21182784) – GoGreen Feb 14 '14 at 06:56
  • I write the views and layout programmingly without `StoryBoard` or `nib` files. – Suge Feb 14 '14 at 07:20
  • This can help: http://stackoverflow.com/questions/20319439/how-to-make-navigation-bar-transparent-in-ios-7 But the blur effect will not work. – kelin Feb 02 '15 at 13:21

2 Answers2

2

It's late, but if anyone need the answer here it is.

If you want transparency in all navigationBar than write following lines in your AppDelegate's -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method:

## Objective C ##

[[UINavigationBar appearance] setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setShadowImage:[UIImage new]];
[[UINavigationBar appearance] setTranslucent:YES];

## Swift ##

UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().translucent = true

For transparency in particular view, check this answer.

Community
  • 1
  • 1
x4h1d
  • 6,042
  • 1
  • 31
  • 46
-2

It should work if you click on the segue between the 2 views in storyboard, then in the attribute "Inspector -> in presentation" select "over Full Screen"

11684
  • 7,356
  • 12
  • 48
  • 71
Maryam Fekri
  • 605
  • 8
  • 19
  • As it currently stands, it is hard to tell what you mean. Could you expand your answer a bit? Does the OP need to change something in the code or adjust something in the configuration of his/her project? – 11684 May 05 '15 at 13:06
  • click on the segue between the 2 views in storyboard, then in the attribute Inspector - > in presentation select "over Full Screen" – Maryam Fekri May 05 '15 at 13:13