UIBarButtonItem is disabled, but has normal color

前端 未结 6 1195
失恋的感觉
失恋的感觉 2021-02-12 19:25

I\'m having an issue with a UIBarButtonItem. I use the appearance proxy to set its color for states Normal and Disabled and I do this in t

6条回答
  •  醉酒成梦
    2021-02-12 20:07

    This was also my issue, when running on iOS versions 10.*. Setting the button's foreground color solved the issue for me.

    self.saveButton.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.gray], for: UIControlState.disabled)
    

提交回复
热议问题