1

I've got a strange bug that I'm hoping isn't an OS issue. I have a split view controller and when I'm in landscape mode the back bar button items appear properly. However, when I reveal the master controller from portrait all of the bar button items are dimmed. I don't have any code that sets these back button items, but they are set using the default behavior. I've got several levels in this master controller and they all subsequently retain the dimmed behavior. Any ideas?

Dimmed UIBarButtonItem Working UIBarButtonItem

Christian Di Lorenzo
  • 3,562
  • 24
  • 33

1 Answers1

2

The dimming suggests that at some point some view controller set the tintAdjustmentMode to UIViewTintAdjustmentModeDimmed and it has never been reset to UIViewTintAdjustmentModeNormal (or, more properly, UIViewTintAdjustmentModeAutomatic). You should try to figure out why this is, but in any case you may be able to work around it just by performing that reset yourself.

EDIT I had another idea: maybe the buttons are not dimmed but tinted. In iOS 7 if you set the tintColor for a bar, it doesn't tint the bar but it does tint the bar button items. It's easy to get caught out by that one...

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Hmm... I thought this would probably fix this issue, but it still doesn't. Any other ideas? – Christian Di Lorenzo May 19 '14 at 19:44
  • Not based on the incredibly small amount of info you've provided in your question, no. – matt May 19 '14 at 20:59
  • Perhaps it is not dimmed but tinted. Did you provide a `tintColor`? Remember, in iOS 7 the bar's `tintColor` tints the bar button items, not the bar. – matt May 19 '14 at 21:00
  • The `tintAdjustmentMode` was my issue. For some reason it never got reset to `.normal`. Adding `navigationController?.navigationBar.tintAdjustmentMode = .normal` to `viewWillAppear()` seems to fix the problem. – c0d3rman Jan 22 '18 at 01:19
  • @c0d3rman Yes, but that's a different matter. You're using iOS 11. It has a serious bug in this regard. See my answer here: https://stackoverflow.com/a/47805384/341994 – matt Jan 22 '18 at 01:26