cocos lua ccui.TextField本文入力ボックスeditbox携帯電話が正常に入力できない
1183 ワード
local motify_bg = self.lbl_modity_bg:GetView()
local x, y = motify_bg:getPosition()
local size = motify_bg:getContentSize()
local ap = motify_bg:getAnchorPoint()
size = cc.size(size.width-20, size.height-20)
self.text_field = ccui.TextField:create(" ", "res/font/cght.TTF", 20)
self.text_field:setPosition(cc.p(x, y))
self.text_field:setAnchorPoint(ap)
self.text_field:setTouchSize(size)
self.text_field:setMaxLength(100)
self.text_field:setMaxLengthEnabled( true)
self.text_field:ignoreContentAdaptWithSize(false) -- 1
self.text_field:setContentSize(size) -- 2
-- self.text_field:attachWithIME()
self.lot_root:GetView():addChild(self.text_field)
self.btn_yes:SetData({onclick=function()
Game("GuildView"):ClosePanel("ModifyNoticeView")
local info = self.text_field:getString() --
if info ~= nil and #info > 0 then
if self:isIllegal(info) then
self.text_field:setString("") --
return
end
self.text_field:setString("")
Tool("Notifier"):Fire("MODIFY_NOTICE", nil, info)
end
end})