external keyboard tab event on ios

北慕城南 提交于 2019-12-12 10:36:12

问题


One of my ipad app screen having multiple textfield. On that few textfields are generating popup for user input action/decision/prepopulate info etc. It is working fine when default ipad keyaboard is using. but when we tried with external keyboard with tab key, I am getting multiple textfieldshouldbeginediting events for all presence textfields. I have added all logic into textfielddidbeginediting methods, but I am not able to hide the keyboard which are popup due to textfieldshouldbeginediting through other key events which are generate due to tab key. how can we stop tab key events from external device? or I dont want to get multiple textfieldshouldbeginediting when tab key is pressed.

I can reproduce this issue through simulator & use macbook keyboard tab key for multiple uitextfields.

TextField becomeFirstResponder Issue for tab key(Keyboard) action


回答1:


I had a similar issue and ended up having to put all logic in textfielddidbeginediting methods.

To dismiss the keyboard, you can just use your own method doing something like:

[self.view endEditing:YES];


来源:https://stackoverflow.com/questions/20903817/external-keyboard-tab-event-on-ios

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