UITextField TapGesture 在 iOS 7.1 上没有响应 [英] UITextField TapGesture doesn't respond on iOS 7.1
问题描述
我有一个以编程方式添加到视图中的 uitextfield.我需要显示一个 UIPickerview,当我点击它时,我为此添加了一个 UITapgestureRecognizer,并且还启用了用户交互.在 IOS 7.0 之前一直运行良好.但是当我更新到没有被调用的 IOS 7.1 时.
I have a uitextfield which is programatically added to view. I need to show a UIPickerview, when i tap on that, I have added a UITapgestureRecognizer for that and user interaction also enabled. Which was working fine till IOS 7.0. But when i updated to IOS 7.1 which is not getting called.
推荐答案
无需为 textField
设置点击手势,您只需设置 inputView
的 code>textField
作为您的 pickerView
.这只是使您能够在文本字段被点击或获得焦点时显示 UIPicker.类似的东西:
Rather than setting a tap gesture for your textField
, you can simply set the inputView
of your textField
as your pickerView
. This simply enables you to show the UIPicker when the textField is tapped or gains focus. Something like:
[YOUR_TEXTFIELD setInputView:YOUR_PICKER_VIEW];
这只是您问题的替代解决方案.你可以试试看.
This is just an alternative solution to your issue. You can give it a try.
这篇关于UITextField TapGesture 在 iOS 7.1 上没有响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!