UIControlEventTouchDragExit只会触发100个像素 [英] UIControlEventTouchDragExit only fires ~100 pixels out
问题描述
我被告知在使用UIControlEventTouchDragExit的另一个答案,但是这个事件只有在触摸距离按钮离开大约100个像素的时候触发,而我希望它是直接的。苹果文档说,根据边界,我明白的是边界,框架是相同的,除非你旋转UIbutton(或任何)
额外的区域是一个内置功能,用于说明使用手指与界面交互的不准确性。如果你想解决这个问题,你必须对UIControl进行子类化,并覆盖 - (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
和相关方法得到你想要的行为。
Im trying to "get" when a finger/touch leaves a UIButton in objective C for iphone. I was told in another answer to use UIControlEventTouchDragExit however this event only fires when the touch gets about 100 pixels away from the button, whereas I would like it to be immediate. The apple docs say that goes according to the bounds however my understand is the bounds and the frame are the same unless you rotate the UIbutton (or whatever)
The extra area is a built-in feature, to account for the inexactness of using a finger to interact with the interface. If you want to get around this, you have to subclass UIControl and override -(BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
and related methods to get the behavior your want.
这篇关于UIControlEventTouchDragExit只会触发100个像素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!