Reputation: 668
I have a UIButton
inside a UIView
in a nib file and I want to disable the highlight when the button is pressed.
However unchecking the box (for all states) 'Highlighted Adjust Image' in Interface Builder for the button doesn't remove the highlight.
I have also tried to disable the highlight programmatically with in an @IBAction:
@IBAction func myButtonTapped(_ sender: UIButton) {
sender.adjustsImageWhenHighlighted = false
}
But the highlight is still here when the button is pressed.
How to disable the highlight when none of the above methods work?
Upvotes: 0
Views: 483
Reputation: 6631
To use adjustsImageWhenHighlighted
your UIButton
type should be set to custom.
Upvotes: 2