Skip to main content
Inspiring
January 31, 2012
Answered

Trouble with keyboard. Possible to hide it? iOS

  • January 31, 2012
  • 2 replies
  • 1826 views

In my game, on the highscore-screen, the user touch the textinput and then the keyboard shows, if I write something and press "done", the keyboard goes away. But if I press "Ok" (addChild-image) before I click "done" on the keyboard, the function is the same, saves the highscore list and then goes to another frame on the timeline, but the keyboard still shows, and you can type something, like there's a textinput, it all goes away when I press "done" on the keyboard.

Is it possible to hide the keyboard, e.g. something like "removeSoftKeyboard"?

This topic has been closed for replies.
Correct answer panurge_web_studio

to hide keyboard set the focus on another display object

stage.focus = anotherdisplayobject;

or uicomponent.setFocus()  (if you're in Flex)

2 replies

panurge_web_studioCorrect answer
Participant
February 6, 2012

to hide keyboard set the focus on another display object

stage.focus = anotherdisplayobject;

or uicomponent.setFocus()  (if you're in Flex)

gronli21Author
Inspiring
February 8, 2012

Thank you, that did the trick

markerline
Inspiring
January 31, 2012

just to clarify you must be talking about the iPhone not the iPad.. On the iPad there is a hide-keyboard key but you can't bring the keyboard back once you press it unless it registers with a text field press.

gronli21Author
Inspiring
January 31, 2012

Ah, ok, good to know. Yes, it's iPhone I've got. If I don't find a good solution, I could always hide my custom "ok"-child and show it when the user presses "done" on the keyboard.