iOS上的外部键盘标签事件 [英] external keyboard tab event on ios

查看:67
本文介绍了iOS上的外部键盘标签事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ipad应用程序屏幕之一,具有多个文本字段.在那几个文本字段上会生成用于用户输入操作/决定/预填充信息等的弹出窗口.当使用默认的ipad键盘时,它可以正常工作.但是当我们尝试使用带有Tab键的外部键盘时,我会收到所有存在状态文本字段的多个 textfield应该开始编辑事件. 我已经将所有逻辑添加到了 textfielddidbeginediting 方法中,但是由于textfield应该通过编辑其他由于制表键而产生的按键事件,因此我无法隐藏弹出的键盘.我们如何停止来自外部设备的Tab键事件?或者我不希望在按下Tab键时获得多个文本字段应开始编辑.

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.

我可以通过模拟器&复制此问题使用Macbook键盘的Tab键用于多个uitextfields.

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

TextField成为Tab键(键盘)操作的FirstResponder问题

推荐答案

我遇到了类似的问题,最终不得不将所有逻辑都放在textfielddidbeginediting方法中.

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];

这篇关于iOS上的外部键盘标签事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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