Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/106.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何获得UIButton';s uicontrolTouchDragins和UIControlTouchDragOutside阈值是帧?_Iphone_Ios_Uibutton_Uicontrol - Fatal编程技术网

Iphone 如何获得UIButton';s uicontrolTouchDragins和UIControlTouchDragOutside阈值是帧?

Iphone 如何获得UIButton';s uicontrolTouchDragins和UIControlTouchDragOutside阈值是帧?,iphone,ios,uibutton,uicontrol,Iphone,Ios,Uibutton,Uicontrol,似乎UIButton和threshold超出了按钮框架的未知量。这个距离似乎只有手指宽度的大小。在没有手指宽度缓冲区的情况下,是否有办法将该阈值设置为实际帧/边界 这在iPad上并不是一个问题,但在iPhone和小型房地产上,它正导致我的自定义控件偶尔工作 谢谢作为解决办法,我正在做以下工作 我已经改变了我和的处理程序 -(IBAction)myButtonsUpInside:(id)sender event:(UIEvent*)event 及 首先检查事件是否应作为其他按钮处理。比如说: N

似乎UIButton和threshold超出了按钮框架的未知量。这个距离似乎只有手指宽度的大小。在没有手指宽度缓冲区的情况下,是否有办法将该阈值设置为实际帧/边界

这在iPad上并不是一个问题,但在iPhone和小型房地产上,它正导致我的自定义控件偶尔工作


谢谢

作为解决办法,我正在做以下工作

我已经改变了我和的处理程序

-(IBAction)myButtonsUpInside:(id)sender event:(UIEvent*)event

首先检查事件是否应作为其他按钮处理。比如说:

NSArray* theTouches = [[event allTouches] allObjects];
UITouch* touch = [theTouches objectAtIndex:0];
if([btnMyOtherButton pointInside:[touch locationInView:btnMyOtherButton] withEvent:event])
     //Call myOtherButton's action.
//Otherwise do this button's action.
您还可以使用和处理程序执行相同的操作,以执行类似的操作。我只需要在润色活动中采取行动


仍然想知道是否有人有任何其他解决方案来摆脱这种奇怪的缓冲区。

好吧,
CGSize treshold=CGSizeMake(YourFingerInPixels的宽度,YourFingerInPixels的宽度)DragInsideEvent在按钮框外一段距离内一直触发。我希望DragInsideEvent会一直启动,直到它到达按钮框的边缘。然后DragOutsideEvent将启动。这并没有发生。
NSArray* theTouches = [[event allTouches] allObjects];
UITouch* touch = [theTouches objectAtIndex:0];
if([btnMyOtherButton pointInside:[touch locationInView:btnMyOtherButton] withEvent:event])
     //Call myOtherButton's action.
//Otherwise do this button's action.