UITextField TapGesture doesn't respond on iOS 7.1

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 02:08:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!