UIButton 高亮区域延伸到按钮外 [英] UIButton highlight area extends way outside button

查看:26
本文介绍了UIButton 高亮区域延伸到按钮外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户触摸 UIButton 时,高亮状态应该开始.当他将手指滑出按钮时(仍然没有抬起手指),按钮高亮应该停止,而当他抬起手指时,按钮不应被触发.

When the user touches a UIButton, the highlight state should start. When he slides his finger outside of the button (still without lifting his finger), the button highlight is supposed to stop, and when he lifts his finger the button should not be triggered.

这种行为正是 iOS 的工作方式,但我对仍然应用高光的有效区域感到有些惊讶.对于小按钮,在高亮停止之前,我必须将手指移动到按钮上方或下方按钮高度的数倍.

This behavior is exactly how iOS works, but I'm a little surprised about the effective area for which the highlight is still applied. For a small button, I have to move my finger several times the height of the button above or below the button before the highlight stops.

这是正常的,还是我做错了什么?高亮区域应该由框架控制还是我可以设置?

Is this normal, or am I doing something wrong? Is the highlight area supposed to be controlled by the framework or is it something I can set?

推荐答案

这是任何 UIButton 框架的正常行为,无论您为按钮选择在触摸时显示高亮显示"还是不选择属性.

This is a normal behavior of a framework for any UIButton whether you select a property of "show High light on touch" or NOT for a button.

但是当使用信息灯"按钮时,行为会发生一点点变化.信息灯"按钮的选择区域比其本身的大小略大.

But there is little bit change in behavior when one use "info light" button . The selection area of "info light" button is slightly bigger than the size of its own .

希望能帮到你.

谢谢:)

这篇关于UIButton 高亮区域延伸到按钮外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆