4

I set a LeftBarButton "Cancel" and a RightBarButton "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 push a ViewController and then pop it back, the OK button looks like being disabled (actually it is still enabled) like this

enter image description here

It is fine with iOS 10 but just grays out with iOS 11 and I don't know why. Any advice will be appreciated.

Zhengqian Kuang
  • 1,079
  • 1
  • 9
  • 12
  • 1
    Having the exact same problem. If you tap on the "Ok" Button and drag a little it will become active, but no idea why this is happening. [link] (https://www.dropbox.com/s/pcasismzqcu6vpr/RightButtonProblem.mov?dl=0) – Chamanhm Jan 26 '18 at 17:38
  • Having the exact same problem. Do you have a good workaround? – Fab1n Feb 05 '18 at 09:46

1 Answers1

0

The problem is gone after the upgrading of iOS/Xcode at some point of time. Definitely it was an iOS defect.

Zhengqian Kuang
  • 1,079
  • 1
  • 9
  • 12