EditBox的使用

来源:互联网 发布:抱枕材料 知乎 编辑:程序博客网 时间:2024/06/05 00:12

local codeInput = cc.EditBox:create(cc.size(350, 50), cc.Scale9Sprite:create())

    codeInput:setPlaceholderFont(activeLayer:GetTtfFont(), 32)

    codeInput:setFont(activeLayer:GetTtfFont(), 32)

    if appLoc ~= 1 and appLoc ~= 16 then

        codeInput:setPlaceholderFont(activeLayer:GetTtfFont(), 28)

        codeInput:setFont(activeLayer:GetTtfFont(), 28)

    end

    codeInput:setPosition(cc.p(625, 177))

    codeInput:setPlaceHolder(getLocalString("input_tip", appLoc)); --输入框的底纹

    codeInput:setReturnType(2)

    codeInput:setFontColor(cc.c3b(0, 0, 0))

    codeInput:setMaxLength(24)

mainLayer:addChild(codeInput, 2)

原创粉丝点击