Hello! I need your help again…
- In my app, I use a native.newTextField to collect user information (user input) but the Text-Field keeps obscuring the user interface ( screenshots )
2. mnTextInputCar:resizeFontToFitHeight is working in the simulator but it isn’t working on an Android device?
Code:
Text-Field
local mnTextInputCar = native.newTextField( display.contentCenterX + 5, lblCar.y, 150, display.contentWidth / 25 )
mnTextInputCar.inputType = “default”
mnTextInputCar:setReturnKey( “done” )
grpUI:insert(mnTextInputCar)
mnTextInputCar.anchorX = 0
mnTextInputCar:resizeFontToFitHeight()
Ui
– grpMeasurement
local rectMenuTouchPreventerCarInfo = display.newRect( grpMeasurement, display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight )
rectMenuTouchPreventerCarInfo:setFillColor( 0, 0, 0, 0.6)
rectMenuTouchPreventerCarInfo.isHitTestable = true – Only needed if alpha is 0
rectMenuTouchPreventerCarInfo:addEventListener( “tap”, function() return true end)
rectMenuTouchPreventerCarInfo:addEventListener( “touch”, function() return true end)
local rectCarInfoInput = display.newRoundedRect( grpMeasurement, display.contentCenterX, display.contentCenterY, display.contentHeight / 2, display.contentHeight / 2, 25 )
local lblAutomodellInput = display.newText( grpMeasurement, “Automodell”, rectCarInfoInput.x, rectCarInfoInput.y, native.systemFontBold, display.contentWidth / 25 )
lblAutomodellInput:setFillColor( 0, 0, 0, 0.6 )
local sheetOptions =
{
width = 384,
height = 384,
numFrames = 6,
sheetContentWidth = 2304, --width of original 1x size of entire sheet
sheetContentHeight = 384
}
local sheetCountdown = graphics.newImageSheet( “img/countdown.png”, sheetOptions )
– sequences table
local sequencesCountdown = {
– consecutive frames sequence
{
name = “Countdown”,
start = 1,
count = 6,
time = 6000,
loopCount = 0,
loopDirection = “forward”
}
}
local animationCountdown = display.newSprite( sheetCountdown, sequencesCountdown )
animationCountdown.x = display.contentCenterX
animationCountdown.y = display.contentCenterY
grpMeasurement:insert(animationCountdown)
grpMeasurement.alpha = 0
– end of grpMeasurement
Groups
sceneGroup:insert(grpBackground)
sceneGroup:insert(grpUI)
sceneGroup:insert(grpMeasurement)
I know its is a big question but I hope somebody can answer them :D
Thanks for helping me out again!!

