How to know when keyboard is hidden after using it?

Hello,

I am about to code a scene to move the display group for editing a text field because it will be hidden by the keyboard. So I need to know when the keyboard goes away. I found this code in the docs. Can I add this to the text field listener and use the ended or submitted event phase? What if the user clicks the Next button to edit the next field. Is there a way I can tell this or what text field it is on so I can adjust the display position again for that text field?

Thanks,

Warren

local defaultField local function textListener( event ) if ( event.phase == "began" ) then -- user begins editing textField elseif ( event.phase == "ended" ) then -- textField/Box loses focus elseif ( event.phase == "ended" or event.phase == "submitted" ) then -- do something with defaultField's text elseif event.phase == "editing" then print( event.newCharacters ) print( event.oldText ) print( event.startPosition ) print( event.text ) end end defaultField = native.newTextField( 150, 150, 180, 30 ) defaultField:addEventListener( "userInput", textListener )

Hi Warren,

You should get an ended phase when the keyboard closes. See this doc for details:

http://docs.coronalabs.com/api/library/native/setKeyboardFocus.html

Best regards,

Brent

Hi Warren,

You should get an ended phase when the keyboard closes. See this doc for details:

http://docs.coronalabs.com/api/library/native/setKeyboardFocus.html

Best regards,

Brent