skip to Main Content

I’m having trouble making my UINavigationBar completely transparent with only the white text & buttons to be shown on it, so that the ImageView I use for ViewController background is completely visible at the top.

I’ve tried this code amongst other:

    // Set the BarTintColor to translucent and text colors to white
self.navigationController.navigationBar.barTintColor = [UIColor clearColor];
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:UITextAttributeTextColor];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

But this is the result, a blackish UINavigationBar, how can I solve this?

The app pushes over from this ViewController to this ViewController where the UINavigationBar fades over to red. There are several other ViewControllers doing the same fade animation, so the UINavigationBar is required

The part of the first ViewController with the “Ny” button will be improved;) – just working on getting my hands on a tool like Photoshop

Thanks!
Erik

3

Answers


  1. add this

    self. navigationController.navigationBar.translucent = YES;
    
    Login or Signup to reply.
  2. This is what I use to make the navigation bar transparent:

    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.translucent = YES;
    
    Login or Signup to reply.
  3. I have found this very similar question.
    Also with an example on Gist

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search