KMNavigationBarTransition icon indicating copy to clipboard operation
KMNavigationBarTransition copied to clipboard

Translucent navbar don't change title color

Open Michae1Nechaev opened this issue 7 years ago • 1 comments

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 avatar Sep 26 '18 08:09 Michae1Nechaev

Have you any ideas, guys?

Michae1Nechaev avatar Oct 15 '18 11:10 Michae1Nechaev