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.
Hide keyboard
-
If the user clicks into a textfield, how can I force them out of it? A user edits a textfield, then presses a button, which should close the keyboard and take the cursor focus from the textfield.
-
I also would like to know how to do this. After entering text into a text field, pressing "done" or "enter" ...how to hide the keyboard?
-
Calling
.end_editing()
on your text field should do the trick.# coding: utf-8 import time, ui @ui.in_background def show_hide_keyboard(text_view, sleep_secs=1): text_view.begin_editing() time.sleep(sleep_secs) text_view.end_editing() time.sleep(sleep_secs) text_view = ui.TextView() text_view.text = str(dir(text_view)) text_view.font = ('<system-bold>', 20) text_view.present() for i in xrange(10): show_hide_keyboard(text_view)
-
Yeah that did it! Thanks!
-
Thanks!