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
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
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