[英]Using UILongPressGestureRecognizer on UITextField to start keyboard
I'd like to use a UILongPressGestureRecognizer
to start the keyboard, but I find that the UITextField still starts the keyboard when double tapped. 我想使用
UILongPressGestureRecognizer
来启动键盘,但是我发现两次轻击时,UITextField仍会启动键盘。
Is it possible to make UITextField
ignore all other gestures? 是否可以使
UITextField
忽略所有其他手势?
Adding a gesture recognizer won't necessarily override the standard gestures for a control, unless the standard gesture is the same as or is a subgesture of the recognizer's gesture. 添加手势识别器并不一定会覆盖控件的标准手势,除非标准手势与识别器手势相同或属于该手势。 This implies that you can override the standard gesture by attaching a matching recognizer (eg UITapGestureRecognizer) and setting no action for it.
这意味着您可以通过附加匹配的识别器(例如UITapGestureRecognizer)并对其不设置任何操作来覆盖标准手势。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.