Search code examples
iosswiftuinavigationcontrolleruinavigationbar

Navigation Controller with translucent effect


My app have a problem with navigation controller. After I set a theme with chameleon and login with facebook. My app segue to initialView, but navigation controller appearance is wrong.

wrong

The correct is

correct

I try to define barstyle, translucent, background color and nothing.

Ps: The icons in first pic are blue because I set bartintcolor of navigationbar.

So, what I can do?


Solution

  • Here is my snippet which should work in Swift 3.

        navigationController?.navigationBar.isTranslucent = true
        navigationController?.navigationBar.tintColor = UIColor.white
        navigationController?.navigationBar.barTintColor = UIColor(colorLiteralRed: 0.113725, green: 0.450980, blue: 0.890196, alpha: 1)// Set to any colour   
    

    Output:

    enter image description here