Uicontroleventtouchdown the method that should be triggered when the button is pressed. The actual use of the process will be delayed response or intermittent unresponsive, but release the finger will respond directly to Uicontroleventtouchdown, UIControlEventTouchUpInside two methods, in which case, press the button does not respond to any events, When you move your finger, it responds to Uicontroleventtouchdown.
1. Delayed response:
This is usually because the button is placed above the Uiscrollview or UITableView, and the system will determine if the swipe gesture is being pressed. will be UIScrollVIew的delaysContentTouches
、
canCancelContentTouches
两个属性都设置为NO;
2.无响应:查到的资料,有人说“
UIControlEventTouchDown事件是一旦手指碰到按钮就调用了,这样在iOS7上会产生一个冲突,由于iOS7加上了手势滑动返回这么一个动作,
在手势滑动返回时那个区域是不允许有UIControlEventTouchDown事件的,不然就会有事件冲突了,系统不知道是要准备返回还是要点击那个Button,
所以就加上了TouchDown事件的一个延迟响应。
解决方案
禁止所有滑动返回的手势,让TouchDown能够正常响应 self.navigationController.interactivePopGestureRecognizer.delaysTouchesBegan=NO;
重写UIButton,捕捉所有的手势事件然后重写
”。
I have no effect on this test, maybe my posture is wrong? My button is in the bottom right corner of the ipad when it's flat screen, and then I find it's OK to move the button up a bit (I moved up 20 pixels). Both of these cases are passed by the ipad Air test and are for informational purposes only.
[iOS advanced] UIButton workaround for unresponsive or delayed response to Uicontroleventtouchdown events