UIButton忽略触摸,如果你触摸它没有图像alpha.我可以改变它来应对触摸它的整个界限吗?
解决方法@H_301_4@
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?
我认为仍然有效的一个简单的方法是将背景颜色设置为仅仅是透明的.一个非常小但仍然大于0.1的alpha应该看起来是透明的,但仍然反应触动.
否则,您可以覆盖-hitTest:withEvent:即使触摸的区域是透明的,它也返回YES.
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?
我认为仍然有效的一个简单的方法是将背景颜色设置为仅仅是透明的.一个非常小但仍然大于0.1的alpha应该看起来是透明的,但仍然反应触动.
否则,您可以覆盖-hitTest:withEvent:即使触摸的区域是透明的,它也返回YES.