简体   繁体   English

单击手势识别器不能在UIScrollView上用于resignFirstResponder吗?

[英]Single Tap Gesture recognizer is not working on UIScrollView for resignFirstResponder?

I want to use sigle tap for the first responder to resign (keyboard). 我想对第一响应者使用sigle tap辞职(键盘)。 When my app starts, there is an alert asking for password and when I enter into the app there is a text box and button to create a file. 当我的应用程序启动时,会出现一个警告,要求您输入密码,当我进入应用程序时,会出现一个文本框和一个用于创建文件的按钮。

When I use [singleTap setNumberOfTapsRequired:1]; 当我使用[singleTap setNumberOfTapsRequired:1]时; the button is not responding. 该按钮没有响应。 But when I use the taps as 2 then it works. 但是,当我将水龙头设为2时,它可以工作。 I am confused. 我很困惑。

I believe the event is a touch up inside event. 我相信该事件是内部事件的补充。 In this case, two taps might be creating one event - such that the first tap is considered the down event and the second event is the released event. 在这种情况下,两次轻击可能会创建一个事件-这样,第一次轻击被视为按下事件,第二次轻击被视为释放事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM