Alpha is changed when the button is pressed ios

mip :

I am pretty new to iOS development and I have a question. I have a simple quiz app and I notice that by default when I press a button the opacity is changing. If I print sender.alpha in an IBAction (Touch down) I get 1.0 but while the button is pressed the opacity seems to be reduced to 0.5. If I try to change alpha in the IBAction (Touch Down) to 1 there is no change (still the opacity seems to be reduced to 0.5) but if I change alpha to 0.001 the opacity is changed to my value.

Can you explain this to me?

Thx!

Aviv Frenkel :

When you press the UIButton it state is changed to highlighted when it's clicked. UIButton has different states such as selected, normal, highlighted and more.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=398559&siteId=1