2

I have a '+' button in my main page of my app. It is a UIBarButtonItem. I don't do anything with it in code, only connect it to another view controller in storyboard with segue. The button starts out with its normal blue color. After I dismiss the view controller that was segued to, the bar button item appears gray for some reason. Does anyone know why? Like I said, I do nothing with it in code(nothing connected to the bar button).

EDIT: My main view controller has the '+' bar button, and I segue to a popover. That popover then segues to another controller. When that view controller dismisses, I return straight back to the home screen without actually dismissing the first popover. So, I think it's still a part of the navigation stack. Is this information helpful?

Xcoder
  • 1,433
  • 3
  • 17
  • 37
  • 1
    It is based on Tint colour.. By default, it is that bluish colour provided by Apple. If for some reason one controller has tinted it, then it will change. Unfortunately, it's hard to tell because you have shown no code or storyboards or anything.. Buttons don't just change colours on their own.. Code is not magic, it doesn't "just happen", it's always dependent on the developer(s) (this includes bugs).. – Brandon Nov 29 '17 at 00:58
  • @Brandon Do you know why this was downvoted? – Xcoder Feb 02 '18 at 22:44
  • Not sure. I didn't downvote it. In fact, I will upvote you because it's a valid question. I do not come back to a post randomly 2 months old and downvote it lol.. Especially because it is a bug causing the issue, it's not your fault. – Brandon Feb 03 '18 at 00:20
  • @Brandon Thanks, it seems to be a bug, as said by matt. – Xcoder Feb 03 '18 at 00:22

2 Answers2

1

Special thanks to @matt for helping me with this issue.

It seems like this is a bug in iOS, as shown in this answer.

Xcoder
  • 1,433
  • 3
  • 17
  • 37
  • Hmm, I doubt it has anything to do with the popover. More likely a duplicate of this: https://stackoverflow.com/questions/47754472/ios-uinavigationbar-button-remains-faded-after-segue-back In other words, this is a clear bug. – matt Dec 24 '17 at 19:04
  • the moderators are already on top of the serial downvoting situation – matt Dec 24 '17 at 19:59
  • Thanks, @matt. I'll look into it. – Xcoder Dec 26 '17 at 19:07
0

Unless explicitly set on the button instance, the UIBarButtonItem inherits tint color from it's parent. So, check if you're somewhere setting tintColor on the navbar, like with navigationController?.navigationBar.tintColor