解决方法
以下代码将检测您何时按下文本字段,阻止其显示键盘,然后打开使用键盘上下移动的本机对话框.它将从原生对话框中获取输入,最后将其放回textField中:
textField.setOnscreenKeyboard(new TextField.OnscreenKeyboard() { @Override public void show(boolean visible) { //Gdx.input.setOnscreenKeyboardVisible(true); Gdx.input.getTextInput(new Input.TextInputListener() { @Override public void input(String text) { textField.setText(text); } @Override public void canceled() { System.out.println("Cancelled."); } },"Title","Default text..."); } });
祝好运!