强制屏幕键盘显示何时连接蓝牙键盘 [英] Force on screen keyboard to show when bluetooth keyboard connected

查看:157
本文介绍了强制屏幕键盘显示何时连接蓝牙键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将蓝牙扫描仪连接到我正在开发的应用程序。扫描仪充当键盘输入,但没有按键,只有一个按钮可以扫描。我遇到的问题是有一些用户需要在屏幕上与之交互的UITextField。

I have to have a bluetooth scanner connected to an app I am developing. The scanner acts as a keyboard input but there are no keys, only a button to scan with. The problem I am running into is there are a few UITextFields that a user needs to interact with on the screen.

当用户点击文本字段输入数据时,没有键盘弹出,因为iOS认为有一个完整的键盘通过蓝牙连接。

When the user taps the textfield to enter in data, no keyboard pops up because the iOS thinks there is a full keyboard attached via bluetooth.

当UITextField成为第一响应者时,如何强制屏幕键盘显示?

How can I force the screen keyboard to show up when the UITextField "becomes first responder" ?

提前致谢!

推荐答案

问题在于蓝牙扫描仪假装是一个蓝牙键盘,所以iOS认为它不需要显示在屏幕上。

The problem is that the Bluetooth scanner is pretending to be a Bluetooth keyboard, so iOS thinks that it doesn't need to show the onscreen one.

不幸的是,这没有简单的答案。有些扫描仪有一个可以按下的按钮,会强制屏幕键盘出现。有些允许您在iPhone模式(或类似的东西)中配对,这样它就不会充当蓝牙键盘。

Unfortunately there's no easy answer for this. Some scanners have a button you can press that will force the onscreen keyboard to come up. Some allow you to pair in "iPhone mode" (or something similar) so that it doesn't act as a Bluetooth keyboard.

这个相关问题的答案(< a href =https://stackoverflow.com/a/3837131/493988> https://stackoverflow.com/a/3837131/493988 )看起来像是基于UITextField的inputAccessoryView的hack,但是我没有亲自验证过,所以我不能说太多。祝你好运!

This answer to a related question (https://stackoverflow.com/a/3837131/493988) has what seems like a hack based on a UITextField's inputAccessoryView, but I haven't personally verified it so I can't say much about it. Good luck!

这篇关于强制屏幕键盘显示何时连接蓝牙键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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