如何弹出“?”123年“安卓键盘

时间:2022-02-27 20:46:10

I have an EditText which needs to process either numerical and/or alphabetical input depending on state. The user may enter either type of input in some circumstances. I've only been able to pop-up the "Phone" keyboard using setInputType (InputType.TYPE_CLASS_NUMBER); which works, but doesn't allow the user a way to get back to the QWERTY keyboard. Since most of the input is indeed numerical, I would like to present the user with the ?123 keyboard most of the time. They would only need to go back to the QWERTY keyboard a few times.

我有一个EditText,它需要根据状态处理数字和/或字母输入。在某些情况下,用户可以输入任何类型的输入。我只能使用setInputType (InputType.TYPE_CLASS_NUMBER)弹出“Phone”键盘;它可以工作,但是不允许用户返回QWERTY键盘。由于大部分的输入都是数值的,所以我想在大多数情况下向用户展示123键盘。他们只需要回到QWERTY键盘上几次。

How can I pop-up the onscreen QWERTY keyboard for alphabetical input, and then pop-up the "?123" keyboard if it's numerical? I just want to save a step for the user so they don't have to hit the ?123 button on the QWERTY keyboard every time.

如何在屏幕上弹出按字母顺序输入的QWERTY键盘,然后弹出“”?如果是数字键盘?我只是想为用户保存一个步骤,这样他们就不必每次都按QWERTY键盘上的123键。

Update: This is the keyboard I would like visible. The reason is I would like the user to easily switch between Alphabetical input and Numerical input. There is no way to switch to the QWERTY keyboard from the "number pad". In my app, numerical input is required for 90% of the input so I would like to pop it up as a convenience. In other words, rather than having to switch to the numerical keyboard 90% of the time, they only need to switch to QWERTY 10% of the time 如何弹出“?”123年“安卓键盘

更新:这是我想看到的键盘。原因是我希望用户可以在字母输入和数字输入之间轻松切换。没有办法从“数字键盘”切换到QWERTY键盘。在我的app中,90%的输入都需要数字输入,所以我想把它弹出方便。换句话说,与其在90%的时间内切换到数字键盘,他们只需要在10%的时间切换到QWERTY键盘。

The call to input.setRawInputType(Configuration.KEYBOARD_QWERTY); works differently on Honeycomb and later versions of Gingerbread (brings up the number pad). On Gingerbread 2.2.3 it works the way I want. Honeycomb and 2.3.7 keyboard screengrabs are below for reference. I don't know why they are so different.

调用input.setRawInputType(Configuration.KEYBOARD_QWERTY);在蜂巢和后来版本的姜饼上工作是不同的。对于姜饼2。2。3,它按照我想要的方式工作。下面是蜂巢和2.3.7键盘截图供参考。我不知道他们为什么如此不同。

如何弹出“?”123年“安卓键盘如何弹出“?”123年“安卓键盘

1 个解决方案

#1


0  

I believe this post answers your question.

我相信这篇文章可以回答你的问题。

In short add this to your code:

简而言之,将其添加到您的代码中:

editText.setRawInputType(Configuration.KEYBOARD_QWERTY);

#1


0  

I believe this post answers your question.

我相信这篇文章可以回答你的问题。

In short add this to your code:

简而言之,将其添加到您的代码中:

editText.setRawInputType(Configuration.KEYBOARD_QWERTY);