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)

  • 相关阅读:
    HashMap:JDK7 与 JDK8 的实现
    es简单介绍及使用注意事项
    mongo学习使用记录2 spring data
    mongo学习使用记录1
    数据库三范式
    mysql数据库中实现内连接、左连接、右连接
    JDK7与JDK8中HashMap的实现
    字符串按照相似度排序
    Linux shell 脚本小记2
    ReentrantLock源码了解
  • 原文地址:https://www.cnblogs.com/cci8go/p/4680793.html
Copyright © 2011-2022 走看看