Can I use the soft keyboard without an EditText?

前端 未结 5 1371
傲寒
傲寒 2020-12-30 02:29

I\'m creating a simple typing game in Android. I have no problem getting input from the physical keyboard, but now I\'m trying to get the soft keyboard to appear without the

5条回答
  •  攒了一身酷
    2020-12-30 02:56

    Instead of using visibility="invisible" you can set android:alpha="0" on your EditText. So you still need a EditText but it is not visible and you can get the input from the softkeyboard by an onKeyListener()

提交回复
热议问题