Buttons on the hue navigation bar are sometimes not set

Refer to the following short video: http://screencast.com/t/cmnsqVTh

The problem is related to the color of the navigation button on the navigation bar.

When you first download the application, the navigation bar + its buttons have a default color. Then I push the view controller on the stack, and when a new view loads (in the viewDidLoad method), it sets the hue color of the navigation bar to pink. The navigation bar buttons are also pink as expected. Then I click the back button and the view is pushed from the stack. In the viewWillAppear view view controller of the root view controller, I set the hue color to zero so that it changes the default color again. The navigation bar looks as expected. However, if I press the view controller on the stack again, the hue of the navigation bar will be pink, but the color of the return line button will turn blue by default. Hope this was clear.

So what is the cause of the problem?

+3
source share
3 answers

Sample project: http://www.filedropper.com/testnavigation

It seems like an error occurs with 3.0 devices / simulator. Does not happen with 2.2.1. Spent so much time on this ...

Error Report Sent (7001347)

+2
source

When I upgraded to SDK 4, this is a magical fix.

+1
source

Did you try to put your code in the viewWillAppear method, and not viewDidLoad, for the controller that you want to push the stack on?

Another suggestion is, did you try to set the color when entering the controller and displaying the root controller in a different color than zero?

0
source

Source: https://habr.com/ru/post/1711085/


All Articles