Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translucent navbar don't change title color #135

Open
Michae1Nechaev opened this issue Sep 26, 2018 · 1 comment
Open

Translucent navbar don't change title color #135

Michae1Nechaev opened this issue Sep 26, 2018 · 1 comment

Comments

@Michae1Nechaev
Copy link

Michae1Nechaev commented Sep 26, 2018

ezgif-5-e296070553

I open the same vc two times:
first time I go back using Back button
second time I go back using standard left edge swipe gesture

In first example navBar title don't changed to white color (it keeps black color like on the second vc)
In second example navBar title changed title color to white successfuly.

In both cases runs same code in viewWillAppear and viewWillDissappear methods in same order, but with different result

First vc:

override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        navigationController?.navigationBar.barStyle = .black
        navigationController?.navigationBar.tintColor = .white

        navigationController?.navigationBar.isTranslucent = false
        navigationController?.navigationBar.setBackgroundImage(nil, for: .default)
        navigationController?.navigationBar.shadowImage = nil
}

Second vc:

override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)        
        
        navigationController?.navigationBar.barStyle = .default
        navigationController?.navigationBar.backgroundColor = .clear
        navigationController?.navigationBar.tintColor = MainColor
        
        navigationController?.navigationBar.isTranslucent = true
        navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
        navigationController?.navigationBar.shadowImage = UIImage()
}

override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        
        navigationController?.navigationBar.isTranslucent = false
        navigationController?.navigationBar.setBackgroundImage(nil, for: .default)
        navigationController?.navigationBar.shadowImage = nil
        
        navigationController?.navigationBar.backgroundColor = .clear
        navigationController?.navigationBar.tintColor = .white
}
@Michae1Nechaev
Copy link
Author

Have you any ideas, guys?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant