#build.settings settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay CoronaWindowMovesWhenKeyboardAppears = true, } }, android = { CoronaWindowMovesWhenKeyboardAppears = true, }, } #config.lua application = { content = { width = 640, height = 960, scale = "letterBox", fps = 60, }, #main.lua local rect1=display.newRect(0,0,300,100) local rect2=display.newRect(0,0,300,100) local textfield=native.newTextField(0,0,300,100) rect1.fill={0.6,0.6,0.6} rect2.fill={0.6,0.6,0.6} rect1.x=display.contentCenterX rect2.x=rect1.x textfield.x=rect1.x rect1.y=rect1.height/2 rect2.y=display.contentCenterY+200 textfield.y=display.contentCenterY+200 textfield.hasBackground=false local path=system.pathForFile("log.txt",system.DocumentsDirectory) local f=io.open(path,"w") f:write("standart textfield y: "..textfield.y.." "..textfield.x) f:write("\n") f:close() local function inputevent(event) if event.phase=="began" then local f=io.open(path,"a+") f:write("began textfield y: "..textfield.y.." "..textfield.x) f:write("\n") f:close() elseif event.phase=="submitted" then local f=io.open(path,"a+") f:write("submitted textfield y: "..textfield.y.." "..textfield.x) f:write("\n") f:close() native.setKeyboardFocus(nil) elseif event.phase=="ended" then local f=io.open(path,"a+") f:write("ended textfield y: "..textfield.y.." "..textfield.x) f:write("\n") f:close() end end textfield:addEventListener("userInput",inputevent)
Rob
Every event.phase i have textfield.y=680