开发者

Touchable area of a UIButton

开发者 https://www.devze.com 2023-01-06 12:13 出处:网络
Is there any way to define which area of a UIButton is clickable? In my case I would like to have开发者_StackOverflow中文版 PNGs with an alpha channel overlapping. These PNGs should act as buttons - b

Is there any way to define which area of a UIButton is clickable? In my case I would like to have开发者_StackOverflow中文版 PNGs with an alpha channel overlapping. These PNGs should act as buttons - but only where alpha is > 0. Is there a way?

Best Stefan


Don't do that. According to the Apple Human Interface Guidelines, all UI elements should behave in a consistent manner.


OBShapedButton is an awesome project that will give you a button that will only respond to taps that are in the images area. I've messed with Irregularly Shaped UIButtons and I think OBShapedButton is a little more accurate. Not trying to bash on the other one at all. I've used the other and it works just fine. I've just seen a more accurate hit area with this one.

0

精彩评论

暂无评论...
验证码 换一张
取 消