Hello,
I was wondering if you could all assist me in the following problem I have been experiencing. I am in the process of designing an app with text fields towards the bottom of the screen, but I would like the text fields to change position once touched, so that the keyboard does not overlap them when it pops up.
As such, I created a listener to execute code which changes the Y position of 2 fields when either one is touched, but for some odd reason, the code is not working. If I place the code in a button event listener however, it seems to work fine. Please refer to my code:
----------------email textbox ------------- local textField = native.newTextField( display.contentCenterX, display.contentCenterY + 60, 200, 40 ) textField.placeholder = "Email" textField.isEditable = true --function to handle events local function touchListener( event ) textField.y = display.contentCenterY - 100 textField2.y = display.contentCenterY - 50 end textField:addEventListener( "touch", touchListener )