UIButton ignores touch if you touch it where there's no image alpha. Can I change it to respond to touch on its entire bounds?
UIButton ignores touch if you touch it where there's no image alpha. Can I change it to respond to touch on its entire bounds?
One easy way that I think still works is to set the background color to something that's only mostly transparent. An alpha that's very small but still greater than 0.1 should look transparent but still respond to touches.
Otherwise, yes, you can override -hitTest:withEvent:
such that it returns YES even if the touched area is transparent.
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