I am able to bring up the native keyboard (iOS only tested so far), but I can’t dismiss it. I set the inputType to “number”, and I get the number keyboard with a blank spot in the lower left and the “delete” key in the lower right. There is no “done” or “submit” button. Tapping away from the keyboard doesn’t work either.
So how do you dismiss the keyboard?
[code]
local function fieldHandler( getObj )
– Use Lua closure in order to access the TextField object
return function( event )
print( "TextField Object is: " … tostring( getObj() ) )
if ( “began” == event.phase ) then
– This is the “keyboard has appeared” event
elseif ( “ended” == event.phase ) then
– This event is called when the user stops editing a field:
– for example, when they touch a different field or keyboard focus goes away
print( "Text entered = " … tostring( getObj().text ) ) – display the text entered
elseif ( “submitted” == event.phase ) then
– This event occurs when the user presses the “return” key
– (if available) on the onscreen keyboard
– Hide keyboard
native.setKeyboardFocus( nil )
end
end – “return function()”
end
local numberField = native.newTextField( 150, 130, 30, 30, fieldHandler( function() return numberField end ) )
numberField.inputType = “number”
[/code] [import]uid: 52127 topic_id: 15427 reply_id: 315427[/import]
[import]uid: 52491 topic_id: 15427 reply_id: 57084[/import]