Why doesn't bar button change back to blue? [duplicate]

浪子不回头ぞ 提交于 2019-12-02 03:24:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!