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](https://fooobar.com//img/28db693c641317b5895575953acecae3.png)
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](https://fooobar.com//img/6fbd2d55ccc3dce5e7ff774f43c303ed.png)
This is fine with iOS 10, but just gray with iOS 11, and I don't know why. Any advice would be appreciated.
source
share