UITextField上的UITapGestureRecognizer在IOS 7.1中不再起作用 [英] UITapGestureRecognizer on UITextField no longer works in IOS 7.1

查看:52
本文介绍了UITextField上的UITapGestureRecognizer在IOS 7.1中不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在UITextField上附加了UITapGestureRecognizer,以获得类似下拉"的效果.轻按UITextField时,将显示包含内容的UIPopover.就像7.1之前的魅惑一样工作-现在UITextField成为第一响应者,而手势识别器完全被忽略了.尝试将delaysTouchedBegan设置为YES,但没有帮助.有帮助吗?

I have a UITapGestureRecognizer attached to a UITextField to get a "drop down" like effect. When the UITextField is tapped, I present a UIPopover with the content. This worked like a charm pre 7.1 - Now the UITextField just becomes first responder, and the gesturerecognizer is totally ignored. Tried setting delaysTouchedBegan to YES but it didn't help.Any help?

推荐答案

为什么要使用UITapGestureRecognizer,更好地使用UITextFieldDelegate方法

Why to use UITapGestureRecognizer, better to use UITextFieldDelegate methods

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{

   //Do what you need to do...

}

OR

您可以将textView包裹在UIView中,然后在该视图上添加UITapGestureRecognizer.

You can wrap up your textView in a UIView and add the UITapGestureRecognizer on that view.

这篇关于UITextField上的UITapGestureRecognizer在IOS 7.1中不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆