My code that creates the editfield is pretty customized... My app uses white roundedRects on screen for the input field areas, and my native field creation code (my editing code) is passed in a the onscreen rectangle object -- which it then uses as the background area for the native text editing. (it creates / positions a native field for editing on top of the passed in rectangle object).
The native field itself is set to no background when it is created (so my white rounded rect is the only thing behind the native text - the field itself has no bg, just text).
The actual creation of the native field won't tell you much (the tempx,y etc is data grabbed from my onscreen rounded rect input area).
editTextField = native.newTextField( tempX, tempY, tempW, tempH, keyboardHandlerEditText)
editTextField.font = native.newFont( native.systemFont, inputFontSize )
editTextField.inputType = keyboardType -- passed in
editTextField.align = 'left';
editTextField.text = editText
editTextField.isEditable = true
editTextField:setTextColor( 0,0,0 )
editTextField.hasBackground = false
editTextField.isSecure = isSecure -- passed in
print(" editTextField created -- textSize ==", tempSize)
One note I discovered regarding android text -- corona(?) or something screws up positioning of native android text if the height variable you pass in to the newTextField call (param 4) is not pretty oversized. It doesn't matter in my case, as the background for the native text is disabled (so it's invisible).
What I noticed is that if the height is set at like 30 pixels or something, and your font size is anywhere close to that, the font starts creeping up vertically out of its correct position -- and is not positioned well. I added a little code to double the height of the editfield bg for android, and it seems to position fine vertically
if( utils.isAndroid == true ) then -- Special issue with android
-- Corona / opengl is causing the height to be used weird / incorrectly...
tempH = tray.height * 2
tempY = (tray.y - tempH/2) -- a little extra height is required for android for some reason (corona? opengl?)