Hello,
I am working on this project that Hiep mentioned, and we are creating a very basic text field. Here’s our code:
local function createTextField( x, y, width, height, text, inputType, validator ) local textField = native.newTextField( x, y, width, height ) textField.font = native.newFont( myFont, 16 ) textField.hasBackground = false textField.defaultText = text textField.text = textField.defaultText textField.inputType = inputType textField.validator = validator textField:setTextColor( 255, 255, 255, 255 ) redeemPanel:insert(textField) textField:addEventListener( "userInput", textHandler ) return textField end local firstNameText = createTextField( 254, 278, 235, 60, "First Name", "default" )
Where textHandler deals with text placeholder and validator is optional.
I have also tried a very basic core function:
local textField = native.newTextField( 254, 278, 235, 60 ) textField.font = native.newFont( myFont, 16 )
While both methods work and created text field as intended, we still face with keyboards taking over full screen… with a dialog box showing what I typed and the button “Done” taking up the whole screen. I am testing this on Galaxy Nexus running Android 4.2.2 with stock keyboard. I also noticed that using the same app, when installed on Nexus 7, a 7" tablet, the keyboard does not take over full screen.
I am suspecting this is the OS behavior, but since it is possible to force the keyboard not to have full screen on Android SDK, I am hoping we can achieve the something like this on Corona SDK as well.
Regards,
Nattawat