if anyone wants to check it on an ios device heres the code i used it:
local function inputListener( event ) if event.phase == "began" then elseif event.phase == "ended" then elseif event.phase == "editing" then end end local function createBox(x,y,width,height) local textBox = native.newTextBox( x, y, width, height ) textBox.text = "This is line 1.\nAnd this is line2" textBox.isEditable = true textBox:addEventListener( "userInput", inputListener ) textBox.anchorX=0 return textBox end local widthBox=200 local heightBox=100 local originalPosX=50 local originalPosY=200 local textBox=createBox(originalPosX,originalPosY,widthBox,heightBox) local button=display.newRect(50,50,50,50) local moving=false local function touch(self, event) if event.phase == "began" then display.getCurrentStage():setFocus( self, event.id ) self.isFocus = true print ("touch began") elseif self.isFocus then print (textBox.width, widthBox, textBox.xScale) if event.phase == "moved" then elseif event.phase == "ended" or event.phase == "cancelled" then print( "Button was pressed and released" ) display.getCurrentStage():setFocus( self, nil ) self.isFocus = false if (textBox.xScale\>1) and moving==false then print ("reduce size") moving=true transition.to( textBox, { x=originalPosX, xScale=0.8, time=400, onComplete=function() --local width=textBox.contentWidth -- if textBox then -- textBox:removeSelf() -- textBox=nil -- end -- textBox=createBox(originalPosX,originalPosY,width,heightBox) moving=false end} ) elseif (textBox.xScale\<=1) and moving==false then print ("enlarge size") moving=true transition.to( textBox, { x=originalPosX, xScale=1.25, time=400, onComplete=function() -- local width=textBox.contentWidth -- if textBox then -- textBox:removeSelf() -- textBox=nil -- end -- textBox=createBox(originalPosX,originalPosY,width,heightBox) moving=false end} ) end end end return true end button.touch = touch button:addEventListener( "touch", button )
just copy past and build it. square is the button that makes text box enlarge or shrink.