IOS 11 RightBarButton navigation bar greyed when returning from a clicked ViewController

I set LeftBarButton to Cancel and RightBarButton to OK this way

_barButtonOK = [[UIBarButtonItem alloc] initWithTitle:@"OK" style:UIBarButtonItemStyleDone target:self action:@selector(barButtonOKAction)];
[_barButtonOK setTintColor:BUTTON_TEXTCOLOR];
[self.navigationItem setRightBarButtonItems:@[_barButtonOK]];

_barButtonCancel = [[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStyleDone target:self action:@selector(barButtonCancelAction)];
[_barButtonCancel setTintColor:BUTTON_TEXTCOLOR];
[self.navigationItem setLeftBarButtonItems:@[_barButtonCancel]];


and they look like this

enter image description here

But when I click ViewController and then bring it back, the OK button looks like it is disabled (in fact, it is still turned on), like this

enter image description here

This is fine with iOS 10, but just gray with iOS 11, and I don't know why. Any advice would be appreciated.

+4
source share
1 answer

The problem disappeared after updating iOS / Xcode at some point in time. It was definitely an iOS bug.

0
source

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


All Articles