问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/22323573/uitextfield-tapgesture-doesnt-respond-on-ios-7-1