开发者

How to change the keyboard input type on Android

I know that when using a EditText we can change t开发者_如何学运维he input type using the setInputType(InputType.TYPE_CLASS_TEXT); method. But, I'm not using a EditText, I'm showing the keyboard using the imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY), getting the input values on the onKey event and showing them in a TextView for specific reasons. :)

There's some way to change the input type through the InputMethodManager?

Thanks in advance.


That's quite weird, I can only think two workarounds:

  1. You can try to use an invisible EditText and try if this gets the InputType
  2. You could replace your TextView by an EditText, and then overwrite the style of this EditText with a custom one.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜