By default, we get the opacity of UIButton set to NO. Can we set it to YES?
@IBAction func KeyDownPressed(_ sender: UIButton) { sender. alpha = 0.5 } @IBAction func keyPressed(_ sender: UIButton) { sender. alpha = 1 playSound(col : sender. currentTitle!) }
A control that executes your custom code in response to user interactions.
Um... opacity
is not a boolean value. It is a float
in the range from 0.0 (fully transparent) to 1.0 (fully opaque). The property is actually called the alpha
, so you'd do:
[myButton setAlpha:0.42];
setAlpha doesn't work in In swift:
photoButton.alpha = 0.3
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