zoukankan      html  css  js  c++  java
  • UIEditBox 控件的使用 点击输入框 自动切换 到下一个输入框 并上移 背景

    Quick-3.5

    local editAccount,editPwd
    local function editBoxEventHandler(strEventName,pSender)

      local edit = pSender:getName()
      if strEventName == "return" then
        if edit == "editAccount" then
          local _delay = function ()
            if not tolua.isnull(editPwd) then
              editPwd:touchDownAction(editPwd, TOUCH_EVENT_ENDED)
            end
          end
        scheduler.performWithDelayGlobal(_delay, 0)
        end
      end
    end

    editAccount = cc.ui.UIInput.newEditBox_({
    size = cc.size(340, 60),
    image = "space.png"
    })

    editAccount:setAnchorPoint(cc.p(0,0.3))
    editAccount:setName("editAccount")
    editAccount:setPlaceHolder("4-20位字母或数字组成")
    editAccount:setPlaceholderFont("fonts/fzzy.ttf",24)
    editAccount:setMaxLength(40)
    editAccount:setInputMode(cc.EDITBOX_INPUT_MODE_EMAILADDR)
    editAccount:setReturnType(cc.KEYBOARD_RETURNTYPE_DEFAULT)
    editAccount:registerScriptEditBoxHandler(editBoxEventHandler)
    self.textFileAccount:addChild(editAccount, 2)

    editPwd = cc.ui.UIInput.newEditBox_({
    size = cc.size(340, 60),
    image = "space.png"
    })

    editPwd:setAnchorPoint(cc.p(0,0.3))
    editPwd:setPlaceHolder("6-20位字母或数字组成")
    editPwd:setPlaceholderFont("fonts/fzzy.ttf",24)
    editPwd:setMaxLength(20)
    editPwd:setInputMode(cc.EDITBOX_INPUT_MODE_SINGLELINE)
    editPwd:setInputFlag(cc.EDITBOX_INPUT_FLAG_PASSWORD)
    editPwd:setReturnType(cc.KEYBOARD_RETURNTYPE_DEFAULT)
    self.textFieldPassword:addChild(editPwd, 2)

  • 相关阅读:
    xss漏洞
    web日志分析(待)
    linux命令学习摘记
    浏览器的MIME映射(程序映射)
    文件上传靶场-Upload-Labs
    目录遍历用字典
    cmd、bat分割单行字符串
    iptables使用
    Spring AOP 学习(五)
    Spring 使用注解注入 学习(四)
  • 原文地址:https://www.cnblogs.com/cci8go/p/4680793.html
Copyright © 2011-2022 走看看