1

I cannot for the life of me figure out how allow UIBarButtonItems to be clickable / tappable on iOS 11 on iPad. UIBarButtons work perfectly on iPhones running iOS 11 (and below) and on iPads running iOS 10 and below. Here is the code I'm using to create the UIBarButtonItem on a UITabBarController:

UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Account"] style:UIBarButtonItemStylePlain target:self action:@selector(accountOptions:)];
barButton.imageInsets = UIEdgeInsetsMake(-.5, 0, .5, 0);
self.navigationItem.rightBarButtonItem = barButton;

I've tried adding AutoLayout constraints for width and height programmatically (with at least 2 different ways of going about it), but have had no luck. I may have done them incorrectly, so I am open still to that solution.

I've tested this on both a simulator and a real iPad and have the same result.

I've also read and tried this solution several times with no luck: UIBarButtonItem not clickable on iOS 11 beta 7?

Nishant Bhindi
  • 2,242
  • 8
  • 21
  • Possible duplicate of [UIBarButtonItem not clickable on iOS 11 beta 7?](https://stackoverflow.com/questions/45854203/uibarbuttonitem-not-clickable-on-ios-11-beta-7) – andreylanadelrey Sep 21 '17 at 08:09
  • I have that link in my description. Their solution did not work for this particular problem. – Rico Callirgos Sep 22 '17 at 14:15

1 Answers1

0

View Debug Hierarchy

After clicking View Debug Hierarchy, I was able to find another view in the Navigation which was blocking both the left and right button. This was not an issue in iOS 10, and therefore was quite the painful surprise.