I’ve been struggling with getting the Android build of our in-market iOS app fully working and have narrowed it down to a specific issue with the TextField. I’ve been able to isolate the issue as follows:
-
Calling native.setKeyboardFocus(nil) to clear the focus/remove keyboard will set the focus to another textfield
-
Tapping on a textfield drawn near the bottom of the screen causes all textfields to vanish
#1 above is of particular concern because hiding the keyboard sends a “began” event to another textfield causing undesired execution of code in our app.
#2 is just a plain showstopper.
You can verify the above by running this sample app below and trying the following:
-
Tap on the first textbox (keyboard comes up)
-
Tap anywhere on the screen (keyboard is hidden, but focus jumps to textbox 2)
-
Tap on the 3rd textbox (all textboxes vanish)
local textField = nil
local textField2 = nil
local textField3 = nil
local function hideKeyboard(event)
print ("hideKeyboard called.")
native.setKeyboardFocus(nil)
end
local function main()
Runtime:addEventListener("tap", hideKeyboard)
textField = native.newTextField(display.contentCenterX - 100, display.contentCenterY - 200, 300, 60)
textField2 = native.newTextField(display.contentCenterX - 100, display.contentCenterY, 300, 60)
textField3 = native.newTextField(display.contentCenterX - 100, display.contentCenterY + 200, 300, 60)
end
main()
Can someone please verify this and let me know an ETA on a fix as this is blocking us from being able to publish for Android. [import]uid: 8692 topic_id: 14115 reply_id: 314115[/import]