I have native text fields that look fine on the iPhone, but on Android the positioning is shifted by approximately 150x150 down and to the right. All of my graphics and text are aligned, it’s just the textfields.
Here’s my config.lua:
[lua]application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
xAlign = “left”,
yAlign = “top”,
fps = 60,
imageSuffix =
{
["@2x"] = 2,
},
},
}[/lua]
and here’s my textfield positioning:
[lua] local xPosS = 220
local yPosS = 75
for i=1,8, 1 do
– Create Native Text Field
if isSimulator then
– Simulator (simulate the textField area)
field[i] = display.newRect( 15, 80, 150, 30 )
field[i]:setFillColor( 255, 255, 255 )
else
local tHeight = 30
if isAndroid then tHeight = 40 end – adjust for Android
field[i] = native.newTextField( 15, 80, 150, tHeight, fieldHandler(function() return i end) )
end
field[i].isVisible = false
field[i].x = xPosS
field[i].y = yPosS
yPosS=yPosS+40
field[i].isVisible = true
fieldGroup:insert(field[i])
end[/lua]
I’m looping and adding the field to a group and incrementing the y value for the next field so I have 8 fields placed vertically. I could hard code a shift for Android by -150, but it doesn;t make sense that the starting coordinates would be 70,-75 for Android and 220x75 for iPhone. Am I missing something in the code? [import]uid: 65685 topic_id: 17015 reply_id: 317015[/import]