I am not sure what you mean by “on alpha”, but the routine works on the Simulator and on my iPad
here is a little movie that I made on from the screen of the iPad to show you what it looks like:
https://www.dropbox.com/s/upouxk8hi6ardhn/hideNativeFields.MOV?dl=0
and here is the code:
First I create the native fields with a code like this:
fieldNumber = fieldNumber + 1 theCustomerLastNameField = native.newTextField(10, (firstFieldY-SpaceBetweenFields)+(fieldNumber\*SpaceBetweenFields), fieldWidth, fieldHeight ) theCustomerLastNameField.font = native.newFont( \_G.useFont, 18 ) theCustomerLastNameField.inputType = "default"; theCustomerLastNameField.placeholder = translations["theCustomerLastNameFieldPlaceholder"][language] theCustomerLastNameField.anchorX,theCustomerLastNameField.anchorY = 0,0 theCustomerLastNameField.helptext = "Enter last name" theCustomerLastNameField.fieldNumber = fieldNumber theCustomerFirstNameField.isEditable = true UIGroupOfFields:insert(theCustomerLastNameField)
Then I add the fields to a table and add and eventListener
(the table is defined at the top of the code to make it available for the other routines)
entryFieldTable[1] = theCustomerFirstNameField entryFieldTable[1].id = 1 entryFieldTable[2] = theCustomerLastNameField entryFieldTable[2].id = 2 (...) theCustomerFirstNameField:addEventListener( "userInput", textListener ) theCustomerLastNameField:addEventListener( "userInput", textListener )
In the TextListener I call the code to move the fields
local function textListener(event) if (event.phase == "began") then moveFields(event.target.fieldNumber) elseif ( event.phase == "ended" )then end end
and finally, here is the code that moves and fades the objects in and out
local function moveFields(theIdNumber) local function moveAwaySoShallNotInterfereWithButtons(hide) if hide then local function doMove() -- Move it out of the way so that I can click on the button on the -- top of the screen and not hit the native field for i = 1,4 do local theObject = entryFieldTable[i] theObject.x = totalWidth + 1000. end end timer.performWithDelay( 2000, doMove) else for i = 1,4 do local theObject = entryFieldTable[i] theObject.x = 10 end end end if theIdNumber ~= nil then if tonumber(theIdNumber) \>= 8 then -- Move the top 4 fields out of the way if UIGroupOfFields.y ~= -200 then transition.moveTo( UIGroupOfFields, {y=-200, time=1000, onComplete=moveAwaySoShallNotInterfereWithButtons(true) } ) for i = 1,4 do print("Move item: "..i) local theObject = entryFieldTable[i] local transitionTime = 250\*i transition.fadeOut( theObject, { time= transitionTime } ) end end else -- move the top 4 fields back again if UIGroupOfFields.y ~= topSide then moveAwaySoShallNotInterfereWithButtons(false) transition.moveTo( UIGroupOfFields, {y=topSide, time=1000 } ) for i = 4,1,-1 do local theObject = entryFieldTable[i] transition.fadeIn( theObject, { time=1500 } ) end end end else print("no idnumber") end return true end