Reputation: 18581
The alpha of a UIbutton goes to zero, and it becomes transparent when tapped. Ive added this IBAction
@IBAction func btnTapped(sender: UIButton) {
sender.highlighted = false
//...
}
and the UIButton still gets transparent when touched. How to prevent that?
Upvotes: 9
Views: 2543
Reputation: 442
Did you try something like:
yourButtonClass.setTitleColor(UIColor.blackColor(), forState: .Highlighted)
Upvotes: 1
Reputation: 316
I wrestled with this problem and finally fixed it by changing the button type from System to Custom.
Upvotes: 23