问题
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?
回答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.
回答2:
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
来源:https://stackoverflow.com/questions/47542641/why-doesnt-bar-button-change-back-to-blue