I want to focus a libGDX Textfield from the code without clicking on the Textfield.
Is there a way to do this?
I was having the same question, finally found the answer by looking at TextField code.
You can focus your text field by doing this:
stage.setKeyboardFocus(textField);
//show the keyboard
textField.getOnscreenKeyboard().show(true);
Hope this help someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With