Changing the Tint Color of UIBarButtonItem

后端 未结 8 1894
暗喜
暗喜 2020-12-15 03:31

I have a project using Storyboards and whenever I push a view controller with a segue, the dynamically created bar button item is always blue.

8条回答
  •  旧时难觅i
    2020-12-15 03:44

    Swift 5

    barButtonItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white], for: .normal)
    

提交回复
热议问题