Hi, is there any way to set the focus on input elements in UI Views? I have created a view containing a TextField and a WebView. I'd like to enter commands in the TextField with a Bluetooth keyboard and show the results of these commands in the WebView. It is quite annoying that whenever I hit the return key I need to use my finger to set the focus to the TextField again. Please, how can I do this automatically?
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Posts made by Pythonic
-
How to set the focus on a TextField?
-
RE: How to set the focus on a TextField?
Thank you very much! The problem was that I had copied the delegate example for the TextField from the documentation, but overlooked that it contains a call to
textfield.end_editing()
in thetextfield_should_return
delegate method. Now that I have removed the line it works! -
RE: How to set the focus on a TextField?
Hmm, good idea, but that doesn't work. I was just wondering, because in console mode the cursor stays in the input field after pressing enter, allowing for continuous typing without having to take my hands away from the keyboard. It would be nice if ui.TextField could show the same behaviour.