Hello
I created a sort of Chat: at the bottom of the display there’s a textBox but when I click on it, the keyboard of my phone hides the textBox.
I tried to solve this problem in this way:
local textBox = native.newTextBox( 5, 480, 310, 30 ) textBox.isEditable = true screenGroup:insert(textBox) function inputListener( event ) if event.phase == "began" then textBox.height = 45 textBox.y = 270 print( event.text ) end if event.phase == "ended" then textBox.height = 30 textBox.y = 500 end if event.phase == "editing" then print( event.newCharacters ) print( event.oldText ) print( event.startPosition ) print( event.text ) end end textBox:addEventListener( "userInput", inputListener )
But in this way I don’t consider the fact that the phones have different yCoordinates of the keyboard and the textBox can result too High or too Short.
To be more precise I would like to copy the same mechanism of whatsapp textBox:
when you click on the textBox , it skips perfectly over the keyboard and when the keyboard disappear (clicking on the “back” button on the phone) the textBox returns at the start Position.
Can someone help me??