For some reason, when my button is disabled, the text color turns white. I want it to stay black - how can i do that?
Update for swift 4:
override func drawTitle(_ title: NSAttributedString, withFrame frame: NSRect, in controlView: NSView) -> NSRect {
if !self.isEnabled {
return super.drawTitle(self.attributedTitle, withFrame: frame, in: controlView)
}
return super.drawTitle(title, withFrame: frame, in: controlView)
}
This will make text attributes the same as when button is enabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With