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)

  • 相关阅读:
    ATS缓存数据结构
    Akamai CDN
    spring中的设计模式
    深入解析spring中用到的九种设计模式
    24种设计模式的通俗理解
    JDK中所包含的设计模式
    JDK源码中使用的设计模式
    算法-索引
    JAVA REENTRANTLOCK、SEMAPHORE 的实现与 AQS 框架
    扒一扒ReentrantLock以及AQS实现原理
  • 原文地址:https://www.cnblogs.com/cci8go/p/4680793.html
Copyright © 2011-2022 走看看