I have a button that working fine when his alpha is 1, but when I set the alpha to 0, it doesn't do the functions. (I want the button to be invisible, but still responsive). how do I fix that?
thanks!
Setting the alpha to 0, will disable the UIView and no touch events will be received, so you need to set it to 0.02 at least.
Source is this answer on SO : Does UIButton become disabled when its alpha is set to 0.0?
According to Apple Docs
This method ignores view objects that are hidden, that have disabled user interactions, or have an alpha level less than 0.01. This method does not take the view’s content into account when determining a hit. Thus, a view can still be returned even if the specified point is in a transparent portion of that view’s content.
Any UIView that has alpha lower than 0.01
will be ignored by the touch events processing system, i.e. will not receive touch.
Set it 0.02
at least
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